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
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!
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
I have some problem in installing some external framework. Therefore, I try it in a blank project but the error are the same and I am not sure where i did wrong.error image
It is a little uncommon. It seems like I did install a wrong version of framework as in it appear 40+ error in code syntax.
Also, the error are from Alamofire,AmazonS3RequestManager and so on.
It is my podfile and I just put pod install in the target file directory
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'test' do
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'AlamofireImage', '~> 2.0'
pod 'Firebase', '>= 2.4.3'
pod 'SwiftValidator', '3.0.1'
pod 'AmazonS3RequestManager', '~> 0.8'
pod 'MBProgressHUD', '~> 0.9.2'
end
The code in your screenshot is for Swift 2.2, so you have to update Xcode to the latest version, Xcode 7.3. Your version is too old.
The question is how to cleanly remove Test in cocoapods PodFile ?
I'ved just recently updated cocoapods 1.0.0 to my project
I ran "pod init" to generate a sample PodFile then put in my pods.
Whole bunch of error generated by the xcode test project ProjectNameTests
http://imgur.com/fUOF18i
How can I cleanly remove the tests ? Even if comment it out there is other problems like Bridging-Header.h cannot find dependent header.
In my current PodFile for 1.0.0:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for ProjectName
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'FBSDKShareKit', '~> 4.9'
pod 'SwiftyJSON', '~> 2.3.1'
pod 'Alamofire', '~> 3.0'
pod 'Google/Analytics', '~> 1.0.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'AWSS3'
target 'ProjectNameTests' do
inherit! :search_paths
# Pods for testing
end
end
my previous PodFile, no mention for target project or test:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'FBSDKShareKit', '~> 4.9'
pod 'SwiftyJSON', '~> 2.3.1'
pod 'Alamofire', '~> 3.0'
pod 'Google/Analytics', '~> 1.0.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'AWSS3'
The type of errors you'r defining are not because you have a target to the tests in your Podfile. inherit! :search_paths indicates that this target inherits the pods from the target above it.
One thing you might be getting wrong is that the "target 'ProjectName' do" is not regarding your project name but an actual target of your project.
A target can have a different name then your project.
You can also check the official migration guide Migration Guide.