Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updated FacobookLogin Pod, Got Error: No known class method for selector 'objectForJSONString:error:'

Recently I have updated the Below mentioned pods for FacebookLogin Button implemented in my app

pod 'FacebookCore'
pod 'FacebookLogin'

The versions of both pods are 0.7.0

I had updated the pods using the command

pod update

After updating the when I built the project there is an error in the path

Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/FBSDKLoginManagerLogger.m:163:60: No known class method for selector 'objectForJSONString:error:'

Both these errors is occurring in two places in the same class

No known class method for selector 'objectForJSONString:error:'

NSDictionary<id, id> *clientState = [FBSDKBasicUtility objectForJSONString:parameters[FBSDKLoginManagerLoggingClientStateKey] error:NULL];
like image 594
alpha47 Avatar asked May 30 '19 08:05

alpha47


3 Answers

I had to change FBSDKBasicUtility to FBSDKInternalUtility. Xcode will prompt you to unlock the files to make the change.

like image 146
Chris Avatar answered Nov 08 '22 08:11

Chris


I have also received a notification from Facebook to upgrade the Facebook SDK to 5.0.(Previously it was 4.39.0) Below is the link which shows the latest features of Facebook SDK :

https://developers.facebook.com/docs/app-events/upgrade-guide

If you want to use these then you have to update the SDK and at code level integrate new pods for Facebook as shown in the above link.

If you don't want to use these features then you have to restrict your pods to a specific version so in future pod update the Facebook pods are not changed.

Hope this helps.

like image 42
BhargavR Avatar answered Nov 08 '22 08:11

BhargavR


I had to use Xcode 10 to build an app to support older iOS versions. I would get this error when running to a device (but not a simulator). This error would go away once I started using Xcode 11 again.

like image 23
Daniel Ryan Avatar answered Nov 08 '22 09:11

Daniel Ryan