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 907 forks source link

IOS crashes after login. #621

Open HarmJan1990 opened 5 years ago

HarmJan1990 commented 5 years ago

🐛 Bug Report

Whenever i press the login button i get redirected to the facebook page, fill in my data and get redirected to this screen:

Screenshot from Gyazo

At this point my app crashes and stops working. I have to rebuild the app on the simulator to get it working again. Then the facebook button tells me i'm logged in because it turned it to a logout button.

The error is:

2019-08-14 15:55:33.519930+0200 HappyTaxi[21691:402493] Falling back to loading access token from NSUserDefaults because of simulator bug 2019-08-14 15:55:33.520132+0200 HappyTaxi[21691:402493] Falling back to storing access token in NSUserDefaults because of simulator bug 2019-08-14 15:55:33.521978+0200 HappyTaxi[21691:402493] Falling back to storing access token in NSUserDefaults because of simulator bug 2019-08-14 15:55:33.527994+0200 HappyTaxi[21691:402493] -[__NSDictionaryI viewTag]: unrecognized selector sent to instance 0x60000301cb80 2019-08-14 15:55:33.535286+0200 HappyTaxi[21691:402493] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI viewTag]: unrecognized selector sent to instance 0x60000301cb80' *** First throw call stack: ( 0 CoreFoundation 0x000000010d3678db __exceptionPreprocess + 331 1 libobjc.A.dylib 0x000000010bcd4ac5 objc_exception_throw + 48 2 CoreFoundation 0x000000010d385c94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x000000010d36c623 ___forwarding___ + 1443 4 CoreFoundation 0x000000010d36e418 _CF_forwarding_prep_0 + 120 5 HappyTaxi 0x000000010556527e RCTGetEventID + 78 6 HappyTaxi 0x0000000105564dc0 -[RCTEventDispatcher sendEvent:] + 608 7 HappyTaxi 0x00000001056d14c7 -[RCTFBSDKLoginButtonManager loginButton:didCompleteWithResult:error:] + 1959 8 HappyTaxi 0x000000010527eb6e __35-[FBSDKLoginButton _buttonPressed:]_block_invoke.156 + 238 9 HappyTaxi 0x00000001052848fd -[FBSDKLoginManager invokeHandler:error:] + 285 10 HappyTaxi 0x0000000105284496 -[FBSDKLoginManager completeAuthentication:expectChallenge:] + 2230 11 HappyTaxi 0x0000000105286c9c __70-[FBSDKLoginManager application:openURL:sourceApplication:annotation:]_block_invoke + 92 12 HappyTaxi 0x000000010528012a -[FBSDKLoginURLCompleter completeLogIn:withHandler:] + 554 13 HappyTaxi 0x0000000105286baa -[FBSDKLoginManager application:openURL:sourceApplication:annotation:] + 682 14 HappyTaxi 0x00000001052098ea __67-[FBSDKBridgeAPI application:openURL:sourceApplication:annotation:]_block_invoke + 90 15 HappyTaxi 0x0000000105209724 -[FBSDKBridgeAPI application:openURL:sourceApplication:annotation:] + 708 16 HappyTaxi 0x000000010520b5c3 __58-[FBSDKBridgeAPI _setSessionCompletionHandlerFromHandler:]_block_invoke + 291 17 AuthenticationServices 0x0000000127f6a1bc __100-[ASWebAuthenticationSession initWithURL:callbackURLScheme:usingEphemeralSession:completionHandler:]_block_invoke + 136 18 SafariServices 0x000000012d388601 -[SFAuthenticationSession safariViewController:hostApplicationOpenURL:] + 128 19 SafariServices 0x000000012d3c0f1b -[SFAuthenticationViewController remoteViewController:hostApplicationOpenURL:] + 105 20 SafariServices 0x000000012d3fc414 -[SFBrowserRemoteViewController willOpenURLInHostApplication:] + 68 21 CoreFoundation 0x000000010d36e6ac __invoking___ + 140 22 CoreFoundation 0x000000010d36bc25 -[NSInvocation invoke] + 325 23 libdispatch.dylib 0x000000010eca7db5 _dispatch_client_callout + 8 24 libdispatch.dylib 0x000000010ecab2ba _dispatch_block_invoke_direct + 300 25 FrontBoardServices 0x00000001143890da __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30 26 FrontBoardServices 0x0000000114388d92 -[FBSSerialQueue _performNext] + 451 27 FrontBoardServices 0x0000000114389327 -[FBSSerialQueue _performNextFromRunLoopSource] + 42 28 CoreFoundation 0x000000010d2cedb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 29 CoreFoundation 0x000000010d2ce633 __CFRunLoopDoSources0 + 243 30 CoreFoundation 0x000000010d2c8cef __CFRunLoopRun + 1231 31 CoreFoundation 0x000000010d2c84d2 CFRunLoopRunSpecific + 626 32 GraphicsServices 0x0000000112fde2fe GSEventRunModal + 65 33 UIKitCore 0x0000000116a10fc2 UIApplicationMain + 140 34 HappyTaxi 0x00000001051e8650 main + 112 35 libdyld.dylib 0x000000010ed1c541 start + 1 36 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

To Reproduce

I do not know how to reproduce this error, can't find it anywhere either.

Expected Behavior

I expect it to login to facebook and return the data to me.

Code Example

I only use this code from the FBDK

<LoginButton readPermissions={['public_profile email']} onLoginFinished={ (error, result) => { if (error) { console.log(result.error); } else if (result.isCancelled) { console.log('login is cancelled.'); } else { AccessToken.getCurrentAccessToken().then( (data) => { console.log(data.accessToken.toString()); } ); } } } onLogoutFinished={() => console.log('logout.')} />

Environment

React Native Environment Info: System: OS: macOS 10.14.5 CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz Memory: 84.57 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.7.0 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.10.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 23.0.1, 25.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.0 System Images: android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: 0.59.2 => 0.59.2 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-app-id: 0.2.0 react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7 react-native-rsa-util: 0.0.2

Champkinz commented 5 years ago

Did you fix this ?

HarmJan1990 commented 5 years ago

Nope, can't seem to find the problem.

CapitanRedBeard commented 5 years ago

What iOS Facebook SDK are you using? I think I have similar problem using SDK 5.4