iOS - Facebook Login Error - Unknown Error building URL (com.facebook.sdk.core error 3)

前端 未结 6 1741
执笔经年
执笔经年 2021-02-12 10:30

I am using Facebook login for my iOS app being developed for iOS 8 and onwards. (Latest Facebook SDK is being used)

I have followed all the essential steps described by

相关标签:
6条回答
  • 2021-02-12 10:52

    If you upgraded the Facebook iOS SDK to version 4.39.0, there is a bug that causes this error. Downgrade to 4.38.1 will help you solve this problem. Be sure to downgrade both FBSDKCoreKit and FBSDKLoginKit.

    pod 'FBSDKCoreKit', '~> 4.38.0'
    pod 'FBSDKLoginKit', '~> 4.38.0'
    

    Be sure to clean the build folder and re-build the SDK.

    update: This bug has been fixed in 4.39.1 SDK release. https://developers.facebook.com/docs/ios/change-log-4x/

    0 讨论(0)
  • 2021-02-12 10:59

    For me, the problem was that the Facebook App ID indicated in CFBundleURLTypes > CFBundleURLSchemes in Info.plist were spelled out incorrectly.

    I was importing the app ID from an .xcconfig file so that its underlying value changes depending on whether I'm running a Debug or Release scheme. However, when I printed out the plist file, there were unnecessary quotation marks around the app ID when read from the xcconfig files. For example, where the URL scheme should be fb012345678, it was fb"012345678".

    I tried hardcoding the app IDs correctly into the Info.plist as stated in the Facebook guide, and the FBSDKLoginButton just worked. Safari came up to display the Facebook login screen. You don't have to hardcode the IDs though--just make sure they are substituted correctly in Info.plist.

    0 讨论(0)
  • 2021-02-12 11:01

    In terminal & Navigate to the project folder use

    pod update

    to update to current version 4.39.1

    0 讨论(0)
  • 2021-02-12 11:03

    This is a Facebook SDK bug in version 4.39.0 which is causing this error. In order to solve this bug, simply downgrade both CoreKit and LoginKit to 4.38.0, clear derived data as well as clean build folder (CMD + OPTION + SHIFT + K). Whereas 4.38.1 also works fine.

    pod 'FBSDKCoreKit', '~> 4.38.0'
    pod 'FBSDKLoginKit', '~> 4.38.0'
    

    If you are using FacebookCore and FacebookLogin then do like the following.

    pod 'FacebookCore'
    pod 'FacebookLogin'
    pod 'FBSDKCoreKit', '~> 4.38.0'
    pod 'FBSDKLoginKit', '~> 4.38.0'
    
    0 讨论(0)
  • 2021-02-12 11:05

    I was following the react-native-fbsdk instructions in which you are supposed to copy Framework files/folders into the project. Thus, the Cocoapod approach given above didn't work for me.

    What I did is remove the existing Framework files from the project (Right-click on Framework items -> Delete -> Yes Remove all), and then add the previous versions of the Frameworks again by downloading them from:

    https://developers.facebook.com/docs/ios/downloads/

    0 讨论(0)
  • 2021-02-12 11:11

    I had to do two things to get this working.

    1. Downgrade pods to

    pod 'FBSDKCoreKit', '~> 4.38.0'
    pod 'FBSDKLoginKit', '~> 4.38.0'
    

    2. Remove -ObjC from other linker flags

    Although this has been suggested in facebook developer portal. This was generating the below error:

    com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Unknown error building URL.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题