Search code examples
xcodefacebookreactjsreact-nativefacebook-sdk-4.0

File not found when using FacebookSDK with React Native < 0.40.0


I'm using React Native 0.37.0 (because my project uses react-native-navigation which is yet to support RN >= 0.40.0) and attempting to use the Facebook SDK.

I've followed the instruction steps on react-native-fbsdk's npm page, fully; and double-checked to ensure everything is installed, all the search paths are added etc.

When running my project in XCode I get a Buildtime error in the RCTFBSDK library. In the file RCTFBSDKAppEvents.h: 'React/RCTBridgeModuke.h' file not found.

enter image description here

The import line in that file is the new syntax for React 0.40.0:

#import <React/RCTBridgeModule.h>

Is there anything that I can do to make these versions of frameworks play together? I need the navigation library and the facebook one, so until I find a solution I'm completely blocked.

Anything else I can share to support an answer, just ask.


Solution

  • Probably because you are running the latest version of react-native-fbsdk which only works with RN >= 0.40.

    Try uninstall react-native-fbsdk:

    npm uninstall react-native-fbsdk --save

    Then, reinstall with an older version:

    npm install [email protected] --save