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

1k Views Asked by At

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

2

There are 2 best solutions below

0
xaphod On

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'
0
Nairo On

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