'React/RCTBridgeModule.h' file not found when using react native fbsdk - react-native

I am using react-native-fbsdk in my application.
My react-native version is:0.39.1
I followed the all steps and when I build my project I'm getting the following error.
Can anyone please tell me how to solve this.

There was a breaking change in React-Native 0.40 where the headers have been moved to React namespace.
If you use a version prior to 0.40 you have to change 'React/RCTBridgeModule.h' to 'RCTBridgeModule.h' inside of RCTFBSDKAppEvents.m
See here for more info : https://github.com/facebook/react-native/releases/tag/v0.40.0
Or you can upgrade your react-native version: https://facebook.github.io/react-native/docs/upgrading.html

The latest version of react-native-fbsdk ( which is 0.5.0) only works with RN >=0.40.
For RN <0.40, do the following:
1) Uninstall react-native-fbsdk:
npm uninstall react-native-fbsdk --save
2) Reinstall with an older version and link it:
npm install react-native-fbsdk#0.4.0 --save
react-native link react-native-fbsdk

Related

In, react-native info how to check RN version?

In Terminal,
react-native: 0.68.0 => 0.60.0
does it mean that this project version is 68 or 60? In pacakge.json, i manually changed it to 0.68 and then npm install. and I checked react-native info.
Don't try to change manually react native version because sometimes as per version level some internal files or set up not done properly and it will create issue for running project Use below command for upgrade project
npx react-native upgrade
If you want to upgrade specific version then use below command
npx react-native upgrade 0.68
after then check react native version It will show 0.68

New react-native-app with react-native 0.59.9 or lower

What is the best/easiest way to create new react-native-app using react-native-0.59.9 or lower?
Trying to use https://github.com/futurepress/epubjs-rn , which only runs in react-native 0.59 or lower.
The example app in https://github.com/futurepress/epubjs-rn/EpubReader does not work out of the box.
please use epubjs-rn-62
usage
To use the components in your own app install via npm or yarn
npm install --save epubjs-rn
import { Epub } from 'epubjs-rn';
Then you can add the reader element in your code:
<Epub src={"https://s3.amazonaws.com/epubjs/books/moby-dick/OPS/package.opf"}
flow={"paginated"} />
In order to start a new project with a specific React Native version, you can use the --version
react-native init ProjectName --version="0.59.9"
Check official documentation for more information.
EDIT
But in order to run an older version, you need to downgrade your React Native CLI version according to Compatibility of React Native CLI.
If you have already installed a version of react-native CLI, uninstall it using
npm uninstall -g react-native-cli
Then you have to install an older version as below,
npm install react-native-cli#1.0.0
Hope this will help you.

Issue in React native Version 0.60 ->null is not an object ( evaluating 'RNGestureHandlerModule.Direction')

I'm using react-native-gesture-handler within react-navigation and getting this error
null is not an object ( evaluating 'RNGestureHandlerModule.Direction')
Workspace file is automatically created with new React native version(0.60). And there is no libraries under libraries folder in Xcode project.
I created new project in react native and new project created with react-native version 0.60 automatically. Then I installed following dependencies
npm install —save react-navigation
npm install —save react-native-gesture-handler
After installing I am getting runtime error
null is not an object ( evaluating 'RNGestureHandlerModule.Direction')
I also tried to manually link react-native-gesture-handler dependencies with following steps
Right Click Libraries "Add Files to Project"
/node_modules/react-native-gesture-handlers/ios/RNGestureHandler.xcodeproj
Go to build phases and add libRNGestureHandler.a
Run
After that I am getting following errors
-> File not found
-> File not found
Any suggestion for me to fix this?
Did you try using react-native link react-native-gesture-handler?
For me the solution was:
1) react-native link react-native-gesture-handler
2) cd ios
3) pod install
as now, pod is installed automatically into the project with react-native 0.60
If you use RN > 0.60 you don't have to link react-native-gesture-handler manually as it supports autolinking.
For iOS
cd ios && pod install
For further info see issue #671
Please try to link react-native-gesture-handler then fixed this error
try this command for link gesture-handler pluggin
react-native link react-native-gesture-handler

React Native Configuration Return Error 500, Followed React Native Docs

I have followed all instruction as in docs, but couldn't start my first react native app.Node -v v8.11.4, npm 4.6.1, react-native-cli 2.0.1
See Error Image Here:
Thanks in advance!
You need to clear the watchman cache and delete the node_modules folder and re-install it by using npm install.
If it still not works try updating your RN version to the latest one.

React Native - Can not create new project via react-native-cli when react-native version is > 0.55

I am trying to create new project via react native project via react-native-cli react-native init ProjectName and get the following error
error Found incompatible module info
Visit https://yarnpkg.com/en/docs/cli/add for documentation about this
Error: Command failed: yarn add react-native --exact
Project can be created with the same command when react native version is less then or equal to 0.54
react-native init ProjectName --version react-native#0.54
The following links also did not helped me.
https://github.com/facebook/react-native/issues/14861
https://github.com/yarnpkg/yarn/issues/3227
I solve the problem just moment.
the reason is node version problem.
you can install >10.0 node.
then, react-native init project succeed.
I came across similar issue. Following are the steps I took to solve it.
Noticed the yarn error occurs due to incompatible node module version. It required node version >= 8.0. For this, I changed the node version using nvm:
nvm use 8.0.0
Note: Check first if you have a installed node version >= 8.0 using nvm list. If yes, just use the above command. Otherwise install it by nvm install v8.0.0.
After this, you might come across similar error for npm. I did not have updated npm version. Install latest npm by npm install -g npm#latest
Try to create new react-native project, react-native init HelloWorld.