Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix build error with FBSDKLoginKit in Xcode

My ios app was working fine until I ran "pod install" and updated all of my pods. I'm now getting an error when trying to build in Xcode.

FBSDKLoginKit/FBSDKLoginManagerLoginResult.m:43:25: No known class method for selector 'dictionary:setObject:forKey:'

Here are the FB pod versions used:

Installing FBSDKCoreKit (5.0.0)
Installing FBSDKLoginKit (4.44.1)

Those are not specified in my podfile. I think they're installed as part of FirebaseAuth which is in my podfile.

How can I resolve this?

like image 244
exoman Avatar asked May 04 '19 19:05

exoman


People also ask

Why is my code not working on Xcode?

If you run your app and you get some build errors, that means Xcode has detected that the syntax of your code is wrong. If Xcode is complaining that a specific identifier doesn’t exist, then check that all of your opening curly braces have corresponding closing curly braces.

How to find the error message when your Xcode app crashes?

After the crash, go to Xcode in the lower right hand pane, scroll all the way to the top. So now that you know how to find the actual error message when your app crashes, the next step is to learn to recognize some of the more common types of messages because they will hint at what’s wrong.

Why does my Xcode Interface look different?

My Xcode Interface Is Different 1. Xcode Simulator Errors My iPhone simulator looks different? If your iPhone simulator doesn’t look like the one you see me using in my videos, it’s because your iOS simulator is at a different zoom level.

What does “unresolved” mean in Xcode?

You will often see this error if Xcode cannot find the variable or property you are referring to. “Unresolved” means that Xcode couldn’t find something, and “identifier” is another word for a variable, property, function name, etc. Here are several reasons why you could receive this error:


2 Answers

Add pod 'FBSDKCoreKit', '~> 4.44' to the Podfile.

There's a bug in the 4.x versions of FBSDKLoginKit. Its podspec allow major version updates to its FBSDKCoreKit dependency, but the code doesn't comply.

There's no FBSDKCoreKit version specified in the 4.44.1 version like there is in the 5.0.0 version.

The suggested Podfile change is a workaround for the podspec problem.

The current version of FirebaseUI requires version 4.x of FBSDKLoginKit.

like image 91
Paul Beusterien Avatar answered Oct 03 '22 01:10

Paul Beusterien


In my case, I had to also fix the version of Firebase/Core, like following.

pod 'FBSDKCoreKit', '~> 4.35'
pod 'FBSDKLoginKit', '~> 4.35'
pod 'Firebase/Core', '~> 5.20'

Additionally information

The above case is that you have FirebaseUI/Twitter for Twitter login, which is using TwitterKit internally. But TwitterKit is finished to support. So if you have already used FirebaseUI/Twitter, the following should be used

pod 'FirebaseUI/OAuth'

instead of the below.

pod 'FirebaseUI/Twitter'

At the result, we can use the latest & stable FBSDKCoreKit, FBSDKLoginKit and Firebase/Core.

like image 35
Mitsuaki Ishimoto Avatar answered Oct 03 '22 03:10

Mitsuaki Ishimoto