I have updated to cocoapods 1.1.1 for my XCode 8 Swift 2.0 project and now I'm getting the warning "...target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES ..." in the console. How can I fix this?
Here my podfile
platform :ios, '9.0'
use_frameworks!
def app_pods
pod 'Alamofire', '~> 4.0.0'
pod 'AlamofireObjectMapper','~> 4.0.0'
pod 'RealmSwift', '~> 2.0.2'
pod 'KeychainAccess', '~> 3.0.0'
pod 'ReachabilitySwift', '~> 3'
pod 'SwiftyBeaver', '~> 1.0.1'
pod 'GoogleAnalytics', '~> 3.17.0'
end
def unit_tests
app_pods
pod 'OHHTTPStubs', '~> 5.2.1'
pod 'OHHTTPStubs/Swift', '~> 5.2.1'
end
target 'Demo' do
app_pods
end
target 'App1' do
app_pods
end
target 'App2' do
app_pods
end
target 'DemoTests' do
unit_tests
end
target 'App1Tests' do
unit_tests
end
target 'App2Tests' do
unit_tests
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
I was able to fix this problem by doing the following:
Go into Build Settings
At the top select All and Combined
Under Build Options you should see Always Embed Swift Standard Libraries and it is bold.
Click on it and click delete. It should now be unbolded.
Pod install and the error/errors should go away!
It wont let me post an image because i don't have enough reputation, so here is a detailed screen shot link!
https://cloud.githubusercontent.com/assets/17066507/21532583/93df897e-cd1f-11e6-9f17-d25cb81a2a53.png
The accepted solution works, but now you have to make sure all of your teammates are performing it each pod install.
And we all know they won't.
You could make CococaPods do it automatically, by adding this to the bottom of your Podfile:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.name == 'MyPOD'
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'Yes'
end
end
end
end
More info here: https://www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/
This issue has been fixed in the following pull request https://github.com/CocoaPods/CocoaPods/pull/6068 and it should be out in cocoapods version 1.1.2 . I got the info from the following github issue https://github.com/CocoaPods/CocoaPods/issues/6067
Related
I have a problem with my swift project on XCode. I use Cocoapods for the frameworks.
My project don't build. I have this error : No such module 'ObjectMapper'.
I have tried pod install, pod update, pod deintegrate, clean build folder, delete .xcworkspace file, delete derived data, update XCode, but nothing work.
The problem isn't the code because it had work well for this mac last week and today on other mac. It appeared after changing branches on my git.
Here is my pod file:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
def pods
platform :ios, '13.2'
pod 'RESideMenu'
pod 'Alamofire', '~> 4.5'
pod 'AlamofireImage', '~> 3.1'
pod 'JSONHelper'
pod 'SwiftyJSON'
pod 'Google/Analytics'
pod 'ObjectMapper', '~> 3'
pod 'AlamofireObjectMapper', '~> 5.0'
pod 'RealmSwift', '~> 3.18.0'
pod 'KVNProgress'
pod 'CalendarLib'
pod 'Charts', '3.2.1'
pod 'SwiftEventBus', :tag => '2.2.0', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'
pod 'SwiftHSVColorPicker'
pod 'Crashlytics'
pod 'Toucan'
pod 'RFQuiltLayout'
pod 'Kingfisher'
pod 'CropViewController', :tag => '2.4.0', :git => 'https://github.com/TimOliver/TOCropViewController.git'
pod 'MatomoTracker', '~> 7'
pod 'MaterialShowcase'
pod 'UIDeviceIdentifier', :git => 'https://github.com/squarefrog/UIDeviceIdentifier.git'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if ['RichEditorView', 'Toucan'].include? target.name
config.build_settings['SWIFT_VERSION'] = '4.0'
else
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
target 'targetName' do
pods
end
I am seeing the following error:
Code Signing /Users/mikesimonetta/Library/Developer/Xcode/DerivedData/sorealty-
bymtwudklcqeahacubxoedmawvut/Build/Products/Debug-appletvsimulator/DEV_So's Realty.app/Frameworks/Alamofire.framework with Identity -
/usr/bin/codesign --force --sign - --preserve-metadata=identifier,entitlements '/Users/mikesimonetta/Library/Developer/Xcode/DerivedData/sorealty-bymtwudklcqeahacubxoedmawvut/Build/Products/Debug-appletvsimulator/DEV_So's Realty.app/Frameworks/Alamofire.framework'
/Users/mikesimonetta/Desktop/Projects/Clearbridge/sir-tvos/sothebysrealty/Pods/Target Support Files/Pods-So_DEV/Pods-So_DEV-frameworks.sh: eval: line 113: unexpected EOF while looking for matching `''
Command /bin/sh failed with exit code 2
I have looked all over for a solution to this. I have cleaned the project. I've deleted derived data. I've removed workspace/pods/lock file and built out pods from scratch. Still receiving this issue.
Any help on this blocker would be greatly appreciated. Thanks in advance!
My Podfile:
# Uncomment this line to define a global platform for your project
platform :tvos, '9.0'
target 'So_DEV' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'
end
target 'So_PROD' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'
end
target 'TopShelf_DEV' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'
end
target 'TopShelf_PROD' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'
end
Had this same issue, and it was solved by adding a post_install script in the Podfile to update the EOF character for each target. Not entirely sure what the root issue is, and why other projects I've worked on haven't had this same issue.
Found the solution/workaround here - https://github.com/CocoaPods/CocoaPods/issues/7090
And implemented it a little differently with some modifications to the script. It now looks like this:
post_install do |installer|
installer.aggregate_targets.each do |target|
if target.name == 'Pods-Target_2' || target.name == 'Pods-Target_1'
frameworkPath = "Pods/Target Support Files/#{target.name}/#{target.name}-frameworks.sh"
puts "Found #{frameworkPath}"
text = File.read(frameworkPath)
new_contents = text.gsub(/'\$1'/, "\\\"$1\\\"")
File.open(frameworkPath, "w") {|file| file.puts new_contents}
puts "Updated #{target.name} framework file with proper EOF characters"
end
end
end
Hope this helps!
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Alamofire', '~> 3.5' end
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
This is the pod file, swift 2.3, Xcode VERSION 7.3.1. I'm trying to install alamofire , but I'm getting the error above, i searched google , but there wasn't any useful things to do. any help?
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'MyProject' do
use_frameworks!
# Pods for MyProject
pod 'Alamofire', '~> 4.7'
end
Hopefully this must work. Check for your Pod version also.
First of all try make higher deployment target
if not work then
Try to run these command one by one
pod repo remove master
pod setup
pod update
I'm migrating my iOS application to Xcode8 and Swift 3. I updated the dependencies version, everythings looks fine except for the SQLite.swift.
In my project on the line "import SQLite" I've this error:
"Module compiled with Swift 2.3 cannot be imported in Swift 3.0 ..."
while I'm targeting the latest version of SQLite.swift.
I also set "Use Legacy Swift Language Version" to yes for the Target "SQlite.swift" under the Pods project.
Any idea what I'm missing ?
My pod file looks like this:
platform :ios, '8.0'
use_frameworks!
target 'XYZ' do
pod 'OAuthSwift', '~> 1.0.0'
pod 'SwiftyJSON', '~> 3.1.1'
pod 'SQLite.swift', '~> 0.10.1'
pod 'Fabric', '~> 1.6.9'
pod 'Crashlytics', '~> 3.8.2'
pod 'PagingMenuController', '~> 1.4.0' #2.0.0 require iOS9+
pod 'SDWebImage/WebP', '~> 4.0.0-beta2'
pod 'ReachabilitySwift', '~> 3'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
I think 0.10 doesn't support swift 3.
Try using the following line in Podfile
pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'master'
use this.definatly work i use this and for me 100% work
use_frameworks!
target 'YourAppTargetName' do
pod 'SQLite.swift', '~> 0.11.3'
end
I've been going round and round for a couple days now trying to figure out why my post_install hook isn't producing the output I'm expecting. Here's my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
target "SCCommon" do
platform :ios, "6.0"
pod 'AFNetworking', '~> 1.2.1'
pod 'Mantle', '~> 1.3'
pod 'PubNub', '3.5.5'
end
target "SCCommon-TestHarness" do
platform :ios, "6.0"
# inhibit_all_warnings!
pod 'SCCommon', :path => '../SCCommon.podspec'
end
target "SCCommon-UnitTests" do
platform :ios, "6.0"
# inhibit_all_warnings!
pod 'OCMock', '2.2.3'
pod 'SCCommon', :path => '../SCCommon.podspec'
end
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == 'Pods-SCCommon-UnitTests'
puts "Setting preprocessor macro for #{target.name}..."
target.build_configurations.each do |config|
puts "#{config} configuration..."
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)','SC_DEBUG_SCCOMMON=1','FOOBAR']
puts config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
puts '---'
end
end
end
end
After running pod update on the above, I get the following output:
Update all pods
Analyzing dependencies
CocoaPods 0.35.0 is available.
To update use: `sudo gem install cocoapods`
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Fetching podspec for `SCCommon` from `../SCCommon.podspec`
Downloading dependencies
Using AFNetworking (1.2.1)
Using Mantle (1.5.1)
Using OCMock (2.2.3)
Using PubNub (3.5.5)
Using SCCommon (0.3)
Generating Pods project
Setting preprocessor macro for Pods-SCCommon-UnitTests...
Release configuration...
$(inherited)
SC_DEBUG_SCCOMMON=1
FOOBAR
---
Debug configuration...
DEBUG=1
$(inherited)
---
Integrating client project
The question I have is: Why isn't the Debug configuration updating with the new macro definitions? You can see in the output that the Release configuration is setup correctly, but not Debug.
Any ideas?
Found the answer to my specific issue in the way I was adding macros. I had to break the config.build_settings ... line into two lines like so:
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == 'Pods-SCCommon-UnitTests-SCCommon'
puts "Setting preprocessor macro for #{target.name}..."
target.build_configurations.each do |config|
puts "#{config} configuration..."
puts "before: #{config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'].inspect}"
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'SC_DEBUG_SCCOMMON'
puts "after: #{config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'].inspect}"
puts '---'
end
end
end
end
As a side note, I was also setting the definition on the wrong target. Now that both of those issues are resolved, I am officially unstuck! Yay!
I used the code, and it worked.
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)','MEMORY_LEAKS_FINDER_ENABLED=1','EVERY']
output:
find MLeaksFinder Release
$(inherited)
MEMORY_LEAKS_FINDER_ENABLED=1
EVERY
find MLeaksFinder Debug
$(inherited)
MEMORY_LEAKS_FINDER_ENABLED=1
EVERY