简体   繁体   中英

Receiver type 'FBSDKError' (aka 'enum FBSDKError') is not an Objective-C class

Upon upgrading the Facebook SDK, I get an error.

The resulting pods are:

Using FBSDKCoreKit (5.0.0)
Using FBSDKLoginKit (5.2.3)
Using FBSDKMarketingKit (5.0.0)
Using FBSDKMessengerShareKit (1.3.2)
Using FBSDKPlacesKit (5.2.3)
Using FBSDKShareKit (5.2.3)
Using Fabric (1.10.2)
Using FacebookSDK (5.0.2)

I have upgraded the SDK like so in the Podfile and ran pod install:

pod 'FacebookSDK'
pod 'FacebookSDK/LoginKit'
pod 'FacebookSDK/ShareKit', '~> 5.0.0'
pod 'FacebookSDK/PlacesKit'
pod 'FBSDKMessengerShareKit'

Expected:

The project compiles.

Actual:

/Pods/FBSDKShareKit/FBSDKShareKit/FBSDKShareKit/Internal/FBSDKVideoUploader.m:78:11: Receiver type 'FBSDKError' (aka 'enum FBSDKError') is not an Objective-C class

There's a build-breaking bug in Facebook's iOS SDK again . Sigh.

Relevant thread: https://developers.facebook.com/support/bugs/355323518445227/

Summary: change your Podfile to manually force dependency on version 5.2 like this:

pod 'FBSDKLoginKit', '~> 5.2'
pod 'FBSDKCoreKit', '~> 5.2'

The thread signaled by Xaphod https://developers.facebook.com/support/bugs/355323518445227/ did help me fix the problem

The solution was:

1 - First erase the pod files

2 - change pod 'FacebookSDK' for pod 'FacebookSDK/CoreKit'

Now my pod file looks like this:

pod 'FacebookSDK/CoreKit'
pod 'FacebookSDK/LoginKit'
pod 'FacebookSDK/ShareKit'
pod 'FacebookSDK/PlacesKit

3- Run pod update

After the update everything run fine again for me. Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM