React-native: Crash on launch with react-native-fbsdk on ios

Created on 29 Dec 2017  路  3Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.1
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4408382

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.3 => 0.48.3

Target Platform: iOS (10.3)

Steps to Reproduce

(Write your steps here:)

  1. react-native init ( I've tried 44, 45, 46, 47, 48, 49, 50, 51 and all crashed)
  2. react-native install react-native-fbsdk ( I've tried 5.0.0 6.0.0 6.0.3 and all crashed)
  3. Do 2-11 from https://developers.facebook.com/docs/react-native/configure-ios
  4. Xcode -> Build Phases -> Link Binary With Libraries
    If I add libRCTFBSDK.a, the application crashes on launch.
    If I remove libRCTFBSDK.a, the application works but I can't use components of FBSDK

Expected Behavior

The application normally works with libRCTFBSDK.a

Actual Behavior

The application crashes on launch
2017-12-29 8 04 19
2017-12-29 8 04 32
2017-12-29 8 04 32 1

Reproducible Demo

https://github.com/oxy88/fbsdk

(Paste the link to an example project and exact instructions to reproduce the issue.)

It works with Android but never works with IOS.
I have tried many versions but nothing worked.
Maybe this is the problem of react-native-fbsdk but there aren't Issue on react-native-fbsdk.

Locked

Most helpful comment

Try running the project in Xcode and viewing the application output from Xcode. When I ran your project the following error appeared:

Terminating app due to uncaught exception 'InvalidOperationException', reason: 'fb-messenger-share-api is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0'

So you need to add fb-messenger-share-api to the LSApplicationQueriesSchemes array in your Info.plist file. I tested that and your app was no longer crashing for me.

All 3 comments

Try running the project in Xcode and viewing the application output from Xcode. When I ran your project the following error appeared:

Terminating app due to uncaught exception 'InvalidOperationException', reason: 'fb-messenger-share-api is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0'

So you need to add fb-messenger-share-api to the LSApplicationQueriesSchemes array in your Info.plist file. I tested that and your app was no longer crashing for me.

@adrianfalleiro Wow! It works! Thank you! Next time I'll check by Xcode!

@adrianfalleiro its worked Thanks

Was this page helpful?
0 / 5 - 0 ratings