i'm using Xcode 8 beta 6 with swift 3 and i installing alamofire 4.0.0 beta 1 from cocoapods with using this code
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'swift3'
after installing, i open xcworkspace file but its erorr and Xcode ask for converting code from swift 2.2 to 3. I also set platform target to ios 9.0 but it's still not works. anyone can help? thanks
Related
I'm using xCode 13 beta 4 and want to archive my project containing Kingfisher.
The app runs fine under iOS 15, however I get the following errors when I look to archive it. Anyone with an idea what I should do? Thanks!
If you are using Xcode 13, here is a workaround.
If you need to use Xcode 13 but cannot upgrade to v7, use the version6-xcode13 branch. However, you have to drop iOS 10 support due to an Xcode 13 bug.
pod 'Kingfisher', :git => 'https://github.com/onevcat/Kingfisher.git', :branch => 'version6-xcode13'
Having Xcode 13 upgrade, after pod update, I start getting the same issue as you, after a workaround, I found two ways:
Downgrade Kingfisher to 5.x like:
pod 'Kingfisher', '~>5.15.7'
OR
In Deployment Info, upgrade your iOS support version to 12.0
Waiting for any fix from Kingfisher, I opted for downgrading to 5.x
Using Kingfisher 7.0.0 beta version should solve it.
E.g. pod 'Kingfisher', '~> 7.0'
This script worked for me on Xcode 13
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
I see lots of warnings in Facebook libraries after installing Facebook Cocoa pods in xcode 11 beta 7. I am assuming I need an upgrade or different version of facebook pods for Xcode 11. Any ideas?
Just installed Pods and see lots of warnings
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
I expected to see no errors after installing Pods.
I have downloaded a legacy swift app using git and run pod update. After git add -A, I open the workspace using xcode 8 beta then Product -> Clean and build I get 40 swift compiler Alamofire errors. I have not run convert o swift 2.3 or swift 3.
Podfile.lock has version 3.4.1 for Alamofire.
in Podfile I set the version to ios 10.0 and in Alamofire info also set infoDictionary version to 10.0 but it made no difference.
Mostly they are syntax errors like NSURL needs to be renamed URL, etc.
I can't find any answers to this problem with Google.
Xcode 8 compiles against the iOS 10 SDK. This differs slightly from the iOS 9 SDK and thus the errors. You won't be able to use Xcode 8 with Swift 2.2 code.
If you look at the Alamofire branches, https://github.com/Alamofire/Alamofire/branches, you'll see work on 2.3 and 3.0 compatibility.
Also, read this thread for details on how to use those branches: https://github.com/Alamofire/Alamofire/issues/1312.
Old Cocoapods Configuration
I am using Xcode 7 Beta 4. Initially I was using Cocoapods version 0.38.2 and when I ran pod install --verbose in Terminal it said it downloaded dependencies for Bolts, FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit, FBSDKMessengerShareKit, and Pods for iOS 8.1. With this setup my app compiled successfully. Below is the Podfile and Objective-C Bridging File that I used to import the Facebook SDK (so Swift recognises its referenced methods and Objective-C classes). Note that the specific versions shown in my Podfile are also the versions that get installed even if I do not explicitly specify them at the time of this writing.
Podfile
xcodeproj '/Users/<my_username>/MyApp/MyApp.xcodeproj'
pod "FBSDKCoreKit", "~> 4.7.0";
pod "FBSDKLoginKit", "~> 4.7.0";
pod "FBSDKShareKit", "~> 4.7.0";
pod "FBSDKMessengerShareKit", "~> 1.3.1";
MyAppObjCBridging.h
#ifndef MyAppObjCBridging_h
#define MyAppObjCBridging_h
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKMessengerShareKit/FBSDKMessengerShareKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
#endif
Problems encountered when updating to Cocoapods v0.39.0 (from v0.38.2)
The console showed the message "CocoaPods 0.39.0 is available. To update use: gem install cocoapods. Until we reach version 1.0 the features of CocoaPods can and will change. We strongly recommend that you use the latest version at all times.", so I installed the this latest version of Cocoapods 0.39.0 by executing sudo gem install cocoapods in Terminal.
But when I compiled my app it gave me the following errors:
/Users//MyApp/MyApp/MyAppObjCBridging.h:14:9: 'FBSDKCoreKit/FBSDKCoreKit.h' file not found
In Xcode I "Product > Clean" (CMD+SHIFT+K), but this did not make any difference. So I ran sudo gem uninstall cocoapods in Terminal (which listed 0.38.2 and 0.39.0 as the versions that were currently installed) and selected version 0.39.0 from the list to uninstall the latest version and revert back to 0.38.2. I then ran pod install --verbose. When I tried to compile my app it compiled successfully and ran in Simulator again.
Question 1
Why does it give the error that it can't find "FBSDKCoreKit/FBSDKCoreKit.h" when I use Cocoapods version 0.39.0 instead of the older version 0.38.2?
Question 2
If when using Cocoapods version 0.38.2 (the version that compiles with my app) I decided to add platform :ios, '9.0' to the first line of my Podfile (above its existing contents) and run pod install --verbose in Terminal, the Terminal messages tell me that it installs each pod target for iOS 9.0 (instead of iOS 8.1) (i.e. - Installing targetFBSDKCoreKitiOS 9.0).
When I then run my app it successfully compiles and opens in Simulator and displays some new warnings associated with iOS9, most of which I understand. However I do not understand why this one appears. Why is this warning appearing?:
ld: warning: directory not found for option '-L/Users/Ls/code/swift/FreeWifiSearch/FreeWifiSearch/build/Debug-iphoneos'
Question 3
When using Cocoapods version 0.38.2 (the version that compiles with my app), if I decided to add use_frameworks! to the first line of my Podfile, and platform :ios, '9.0' to the second line of my Podfile (above its existing contents), and then run pod install --verbose in Terminal, the Terminal messages tell me that it installs each pod target for iOS 9.0 (instead of iOS 8.1).
When I then run my app the following errors appear:
Use of unresolved identifier 'FBSDKLoginButton'
Use of unresolved identifier 'FBSDKLoginManager'
Use of unresolved identifier 'FBSDKLoginBehaviour'
Why does adding use_frameworks! to the top of my Podfile prevent me from using the Facebook SDK identifiers? (noting that when I don't have use_frameworks! at the top of my Podfile my app successfully compiles and runs in Xcode Simulator, and I can successfully retrieve a Facebook SDK Access Token and login to Facebook)
Since posting the original questions the following was performed and resulted in no compiler errors:
Updated from Xcode 7 Beta 4 to Xcode 7.1.1 by downloading latest from App Store
Added use_frameworks! and platform :ios, '9.0' to top of Podfile
Changed deployment target to iOS 9.0: Project Settings > Targets > General > Deployment Info > Deployment Target > 9.0
Updated CocoaPods to v0.39 with sudo gem install cocoapods
Reinstalled pods with pod update --verbose
Added import FBSDKLoginKit above the class containing Facebook SDK methods
Performed Clean (Shift+CMD+K) and Run (CMD+R) in Xcode to test on device
Add "${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit" in your target's Header Search Paths in Build Settings
For me it's OK now(CocoaPods 0.39, FBSDK 4.10)
I try to migrate my existing Apple Watch app to watchos2 but fail to get realm.io running on the watchkit extension.
The Realm documentation describes how to get everything running with Swift 2.0:
use_frameworks!
pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-2.0'
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-2.0'
And on Realm news from end of June it was mentioned that watchos support is on the way with Pull Request 2139. It seems that changes in this PR are not merged into any branch.
When I run the watchkit extension with the swift-2.0 branch I get the following error:
dyld: Library not loaded: #rpath/Realm.framework/Realm
....
Reason: no suitable image found. Did find:
/.../DerivedData/Build/Products/Debug-iphonesimulator/Realm.framework/Realm: mach-o, but wrong architecture
Are there any plans to merge the watchos2 support soon and make it accessible? Or are there other recommendations or resources to get Realm running on the Apple Watch?
What versions of Xcode and CocoaPods are you using? I believe that CocoaPods actually needs some unreleased functionality to work completely with watchOS 2 apps, see https://github.com/CocoaPods/CocoaPods/pull/4004, which will be included in the upcoming 0.39 release.