Invariant Violation: requireNativeComponent: "RNSScreen" was not found in the UIManager
Solution 1
Finally found the solutions, first by creating new project and secondly re-setup of the react-google-maps library.
Workaround Solution: Created new project, installed all dependencies from scratch, followed step-by-step installation guidelines of react-native screens, and finally moved all my code files into a newly created project. This worked for me :D
After digging into the project code and compared project code with newly generated code, here are my findings:
Actual Problem: We had integrated react-native-google-maps library some time ago, for which I and other developers followed step-by-step guidelines and made changes in the MainActivity.java
file in the android folder. There were some misconfigurations due to which RNSScreen
issue was getting thrown.
Actual Solution Removed react-native-google-maps completely (uninstalled npm packages) and removed Google Maps configuration and did set up the react-google-maps library again
In conclusion, if any of the developers, try to set up google maps in react native, please check the version of react native and react-native-google-maps library and then follow the steps carefully.
Hopefully, this would answer your queries.
Solution 2
Faced the same issue while implementing Navigation. Run following commands
npm install @react-navigation/native
React Navigation is made up of some core utilities and those are then used by navigators to create the navigation structure in your app.
In your project directory, run:
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
This will install versions of these libraries that are compatible.
If you're on a Mac and developing for iOS, you need to install the pods to complete the linking.
npx pod-install ios
Now run
react-native run-ios
Solution 3
I think you are missing to install react-native-screens
components. That is required part in install react navigation guideline.
Dont forget to run pod install
in ios folder after install package from npm.
Solution 4
stop all the terminal servers and then run
npx react-native run-android
if it still does not work,
npm i react-native-screens
and then
npx react-native run-android
Solution 5
Close Metro and run npx run android
to rebuild your code
Amit Agrawal
A passionate, detail oriented Full Stack Developer with extensive knowledge and have strong experience writing state of art Angular Single Page Applications using best practices, design patterns and performance testing. Technology Skills: AngularJS, Angular 4+, Angular Material, Javascript, Grunt, HTML, Node. I personally beleive in simplicity of code while designing/developing complex applications.
Updated on July 09, 2022Comments
-
Amit Agrawal almost 2 years
I am getting RNSScreen error even though I have installed all related packages and followed react-navigation guide (https://reactnavigation.org/docs/getting-started#installation) but nothing worked for me.