CocoaPods v0.39.0 errors on Facebook SDK v4.7

Configuring Old Cocoapods

I use Xcode 7 Beta 4. I originally used Cocoapods version 0.38.2, and when I ran pod install --verbose in the terminal, it said that it loads dependencies for Bolts, FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit, FBSDKMessengerShareKit and Pods for iOS 8.1 . Using this setting, the application compiled successfully. Below is the Podfile and Objective-C Bridging File that I used to import the SDK for Facebook (so Swift recognizes its reference methods and Objective-C classes). Please note that the specific versions specified in my subfile are also versions that are installed, even if I do not explicitly state 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 upgrading to Cocoapods v0.39.0 (from v0.38.2)

The console showed the message "CocoaPods 0.39.0". To upgrade, use: gem install cocoapods. Until we reach version 1.0, CocoaPods features can and will change. We highly recommend using the latest version at all times. "so I installed this latest version of Cocoapods 0.39.0 by running sudo gem install cocoapods in the terminal.

But when I compiled my application, it gave me the following errors:

/Users//MyApp/MyApp/MyAppObjCBridging.h:14:9: 'FBSDKCoreKit / FBSDKCoreKit.h' not found.

In Xcode, I have "Product> Clear" (CMD + SHIFT + K), but that didn't make any difference. So I ran sudo gem uninstall cocoapods in the terminal (which listed 0.38.2 and 0.39.0 as the versions that were currently installed) and the selected version 0.39.0 from the list to remove the latest version and go back to 0.38.2 . Then I ran pod install --verbose . When I tried to compile my application, it compiled successfully and started again in Simulator.

Question 1

Why does this give an error that it cannot find "FBSDKCoreKit / FBSDKCoreKit.h" when I use Cocoapods version 0.39.0 instead of the old version 0.38.2?

Question 2

If when using Cocoapods version 0.38.2 (the version that compiles with my application), I decided to add platform :ios, '9.0' to the first line of my subfile (above its existing contents) and run pod install --verbose in the terminal, terminal messages tell me that it installs every target platform for iOS 9.0 (instead of iOS 8.1) (i.e. - Installing target FBSDKCoreKit iOS 9.0 ). When I launch my application, it successfully compiles and opens in Simulator and displays some new warnings related to iOS9, most of which I understand. However, I do not understand why this appears. Why does this warning appear ?:

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 application), if I decided to add use_frameworks! to the first line of my subfile and platform :ios, '9.0' to the second line of my subfile (above its existing contents), and then run pod install --verbose in the terminal, terminal messages tell me that it installs every target platform for iOS 9.0 (instead of iOS 8.1).

When I launch my application, the following errors appear:

  • Using the unresolved identifier 'FBSDKLoginButton'
  • Using the unresolved identifier 'FBSDKLoginManager'
  • Using an Unresolved Identifier 'FBSDKLoginBehaviour'

Why adding use_frameworks! to the beginning of my subfile does not allow me to use the SDK identifiers for Facebook? (noting that when I don't have use_frameworks! at the top of my subfile, my application successfully compiles and runs in Xcode Simulator, and I can successfully get the SDK access token for Facebook and login to Facebook)

+7
ios9 swift2 cocoapods facebook-ios-sdk xcode7-beta4
source share
2 answers

After the publication of the initial questions, the following was performed and did not lead to compiler errors:

  • Updated from Xcode 7 Beta 4 to Xcode 7.1.1 by downloading the latest version from the App Store.
  • use_frameworks! and platform :ios, '9.0' at the beginning of the subfile
  • Deployment target for iOS 9.0 changed: Project Settings> Goals> General> Deployment Information> Deployment Goal> 9.0
  • Updated CocoaPods to v0.39 with sudo gem install cocoapods
  • Reinstalled containers with pod update --verbose
  • Added import FBSDKLoginKit over a class containing Facebook SDK methods
  • Cleans up (Shift + CMD + K) and starts (CMD + R) in Xcode to test on the device
0
source share

Add "${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit" to the destination header search routes in the build settings

Now it’s OK for me (CocoaPods 0.39, FBSDK 4.10)

0
source share

All Articles