I have installed react-navigation in my React Native project. Its a starter project doesn\'t have any codes. But while running project I am facing
Uninstalled the app from the device and run the android project - react-native run-android and it worked fine
I get the same error on ios from RN v0.60
The following worked for me:
cd ios
pod install
First, remove node_modules
and package-lock.json
and run npm install
.
After installing the react-navigation
package in your React Native project. You should install react-native-gesture-handler. If you’re using Expo you don’t need to do anything here, it’s included in the SDK. Otherwise:
npm install react-native-gesture-handler
And finally, link gesture dependency as:
react-native link react-native-gesture-handler
This answer based on the React Navigation document.
Execute the following commands in command prompt (Run as Administrator)
npm install react-navigation
npm install react-native-gesture-handler
npm intstall
react-native link
Re-Install the application will resolve the issue.
If you are using react-link to link your dependencies:
if you have done the above, it hasn't run yet, try this if you use Windows
cd android
.\gradlew cleanBuildCache
and try running it
react-native run-android