facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

Error: 'com.facebook.sdk:FBSDKErrorDeveloperMessageKey': 'Unknown error building URL.' #432

Open ledth42 opened 5 years ago

ledth42 commented 5 years ago

Hi all, I meet error when press the FBButton when run in ios (both in simulator and my device), pls help me [tid:com.facebook.react.JavaScript] 'Login failed with error: ', { domain: 'com.facebook.sdk.core', message: 'The operation couldn’t be completed. (com.facebook.sdk.core error 3.)', userInfo: { 'com.facebook.sdk:FBSDKErrorDeveloperMessageKey': 'Unknown error building URL.' }, nativeStackIOS: [ '0 MyLoginAppAndroid 0x00000001041d5078 RCTJSErrorFromCodeMessageAndNSError + 152', '1 MyLoginAppAndroid 0x00000001041d4fa0 RCTJSErrorFromNSError + 264', '2 MyLoginAppAndroid 0x00000001043d6f08 -[RCTFBSDKLoginButtonManager loginButton:didCompleteWithResult:error:] + 300', '3 MyLoginAppAndroid 0x00000001043de9d0 __35-[FBSDKLoginButton _buttonPressed:]_block_invoke.149 + 172', '4 MyLoginAppAndroid 0x00000001043e2dfc -[FBSDKLoginManager invokeHandler:error:] + 168', '5 MyLoginAppAndroid 0x00000001043e3a0c 39-[FBSDKLoginManager logInWithBehavior:]_block_invoke + 292', '6 MyLoginAppAndroid 0x00000001043e3b80 39-[FBSDKLoginManager logInWithBehavior:]_block_invoke.289 + 64', '7 MyLoginAppAndroid 0x00000001043e470c -[FBSDKLoginManager(Native) performBrowserLogInWithParameters:handler:] + 368', '8 MyLoginAppAndroid 0x00000001043e37d4 -[FBSDKLoginManager logInWithBehavior:] + 416', '9 MyLoginAppAndroid 0x00000001043e38a0 -[FBSDKLoginManager logInWithBehavior:] + 620', '10 MyLoginAppAndroid 0x00000001043e348c -[FBSDKLoginManager logInWithPermissions:handler:] + 340', '11 MyLoginAppAndroid 0x00000001043e1df0 -[FBSDKLoginManager logInWithReadPermissions:fromViewController:handler:] + 300', '12 MyLoginAppAndroid 0x00000001043de874 -[FBSDKLoginButton _buttonPressed:] + 1356', '13 UIKit 0x000000018e5a964c + 96', '14 UIKit 0x000000018e6ca870 + 80', '15 UIKit 0x000000018e5af700 + 440', '16 UIKit 0x000000018e6e51a8 + 572', '17 UIKit 0x000000018e62c9e0 + 2428', '18 UIKit 0x000000018e621890 + 3160', '19 UIKit 0x000000018e6201d0 + 340', '20 UIKit 0x000000018ee01d1c + 2340', '21 UIKit 0x000000018ee042c8 + 4744', '22 UIKit 0x000000018edfd368 + 152', '23 CoreFoundation 0x00000001847e3404 + 24', '24 CoreFoundation 0x00000001847e2c2c + 276', '25 CoreFoundation 0x00000001847e079c + 1204', '26 CoreFoundation 0x0000000184700da8 CFRunLoopRunSpecific + 552', '27 GraphicsServices 0x00000001866e6020 GSEventRunModal + 100', '28 UIKit 0x000000018e720758 UIApplicationMain + 236', '29 MyLoginAppAndroid 0x000000010409f230 main + 124', '30 libdyld.dylib 0x0000000184191fc0 + 4' ], code: 'ECOM.FACEBOOK.SDK.CORE3' } Thank you so much

LonelyCpp commented 5 years ago

Same error message! Can't seem to fix it

ledth42 commented 5 years ago

Any one can help me :(

ledth42 commented 5 years ago

hi @LonelyCpp , could you try to downgrade to FacebookSDK 4.34, i already fixed this error by using this version, This error takes a alot time :((

LonelyCpp commented 5 years ago

@ledth42 Cheers mate. Downgrading actually worked! I downgraded all pods to 4.38.0

matt-oakes commented 5 years ago

For those not using Cocoapods and installing manually, you can download 4.38.0 here:

https://origincache.facebook.com/developers/resources/?id=FacebookSDKs-iOS-4.38.0.zip

FadiAboMsalam commented 5 years ago

am still facing this issue ! i am using sdk 4.38.0 ! i have included the framework search path to the sdk and imported the core, bolts , share and login framework ! i spent so many hours and am stuck this is really frustrating !

mariopeixoto commented 5 years ago

@FadiAboMsalam I had the same issue and it seems to be related to something that changed in Xcode 10. If you have Xcode 10, try the following (it fixed for me)

Change the Framework search path of the RCTFBSDK.xcodeproj to $(HOME)/Documents/FacebookSDK instead of ~/Documents/FacebookSDK.

You can do that by opening xcode for your react-native project and going into Libraries and look for RCTFBSDK.xcodeproj. Click on that and look for Framework Search Paths under Build Settings. Change from ~/Documents/FacebookSDK to $(HOME)/Documents/FacebookSDK.

It seems that 0682d5d fixed it and landed into master but it's not in the latest release.

FadiAboMsalam commented 5 years ago

@mariopeixoto first of all i appreciate any help fere so thank you and yes am using xcode 10 i tried exactly what you suggested and changed the path but the error remains the same ! did you do anything else by any chance ?!

FadiAboMsalam commented 5 years ago

btw for anyone else downgrading to 4.38.0 seems to solve the problem i reinstallated the sdk again and it worked as expected

moodseller commented 5 years ago

I'm still having this issue, tried downgrading to 4.38.0 and 4.34.0. message: "The operation couldn’t be completed. (com.facebook.sdk.core error 3.)" {com.facebook.sdk:FBSDKErrorDeveloperMessageKey: "Unknown error building URL."}

I tried:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  [[FBSDKApplicationDelegate sharedInstance] application:application
                           didFinishLaunchingWithOptions:launchOptions];
//... rest of the react native code..

Then after, before the @end mark:

- (BOOL)application:(UIApplication *)application
             openURL:(NSURL *)url
   sourceApplication:(NSString *)sourceApplication
          annotation:(id)annotation {
   return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                         openURL:url
                                               sourceApplication:sourceApplication
                                                      annotation:annotation];
}
<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb12345678901234</string>
            </array>
        </dict>
    </array>
    <key>FacebookAppID</key>
    <string>12345678901234</string>
    <key>FacebookDisplayName</key>
    <string>Test</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fb-messenger-share-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    </array>

The build is always successful, the app deploys but whenever I click on the Login button:

0: "0 mobile 0x0000000101c74107 RCTJSErrorFromCodeMessageAndNSError + 135" 1: "1 mobile 0x0000000101c74033 RCTJSErrorFromNSError + 275" 2: "2 mobile 0x0000000101e9edfa -[RCTFBSDKLoginButtonManager loginButton:didCompleteWithResult:error:] + 298" 3: "3 mobile 0x0000000101ea6444 35-[FBSDKLoginButton _buttonPressed:]_block_invoke.149 + 176" 4: "4 mobile 0x0000000101eaa83c -[FBSDKLoginManager invokeHandler:error:] + 158" 5: "5 mobile 0x0000000101eab33b 39-[FBSDKLoginManager logInWithBehavior:]_block_invoke + 283" 6: "6 mobile 0x0000000101eab491 39-[FBSDKLoginManager logInWithBehavior:]_block_invoke.289 + 50" 7: "7 mobile 0x0000000101eabfbc -[FBSDKLoginManager(Native) performBrowserLogInWithParameters:handler:] + 360" 8: "8 mobile 0x0000000101eab198 -[FBSDKLoginManager logInWithBehavior:] + 501" 9: "9 mobile 0x0000000101eaae30 -[FBSDKLoginManager logInWithPermissions:handler:] + 312" 10: "10 mobile 0x0000000101ea97df -[FBSDKLoginManager logInWithReadPermissions:fromViewController:handler:] + 304" 11: "11 mobile 0x0000000101ea62de -[FBSDKLoginButton _buttonPressed:] + 1379" 12: "12 UIKitCore 0x0000000112490ecb -[UIApplication sendAction:to:from:forEvent:] + 83" 13: "13 UIKitCore 0x0000000111ecc0bd -[UIControl sendAction:to:forEvent:] + 67" 14: "14 UIKitCore 0x0000000111ecc3da -[UIControl _sendActionsForEvents:withEvent:] + 450" 15: "15 UIKitCore 0x0000000111ecb31e -[UIControl touchesEnded:withEvent:] + 583" 16: "16 UIKitCore 0x00000001124cc0a4 -[UIWindow _sendTouchesForEvent:] + 2729" 17: "17 UIKitCore 0x00000001124cd7a0 -[UIWindow sendEvent:] + 4080" 18: "18 UIKitCore 0x00000001124ab394 -[UIApplication sendEvent:] + 352" 19: "19 UIKitCore 0x00000001125805a9 dispatchPreprocessedEventFromEventQueue + 3054" 20: "20 UIKitCore 0x00000001125831cb handleEventQueueInternal + 5948" 21: "21 CoreFoundation 0x000000010444c721 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17" 22: "22 CoreFoundation 0x000000010444bf93 CFRunLoopDoSources0 + 243" 23: "23 CoreFoundation 0x000000010444663f __CFRunLoopRun + 1263" 24: "24 CoreFoundation 0x0000000104445e11 CFRunLoopRunSpecific + 625" 25: "25 GraphicsServices 0x000000010aca91dd GSEventRunModal + 62" 26: "26 UIKitCore 0x000000011248f81d UIApplicationMain + 140" 27: "27 mobile 0x0000000101b23cb0 main + 112" 28: "28 libdyld.dylib 0x0000000107b48575 start + 1"

message: "The operation couldn’t be completed. (com.facebook.sdk.core error 3.)" {com.facebook.sdk:FBSDKErrorDeveloperMessageKey: "Unknown error building URL."}

I have been struggling for a couple of days now and can't seem to resolve this, please can someone help me?

UPDATE:

Finally came to a resolution. Apparently when dragging .framework files into the Frameworks/ folder in xCode they appear in your $(PROJECT_DIR) with a reference in Frameworks/ like a symbolic link, the solution was to remove them originally from the project directory and Frameworks/ folder and then manually paste them into Frameworks/ folder and only then drag them to the xCode application's Framework/ folder of your project.

zabojad commented 5 years ago

I'm having this issue too. Isn't there any better solution than downgrading the FBSDK used? That doesn't seem to be a real solution really...

Return-1 commented 4 years ago

This is still an issue. Im using RN 0.60+ with autolinking. Any leads?

danilowoz commented 4 years ago

Hey, any news about that?

My solution: I just forgot to fill these informations on Info.plist https://github.com/facebook/react-native-fbsdk/blob/master/example/ios/RNFBSDKExample/Info.plist#L69