0

I am working on a gitlab project with my friend, windows 10, I have pulled from master and there were few conflicts that I had to solve and I did npm install however when I run my android project by using npx react-native start and then from android studio I run by going to tools->AVN manager->start, my app starts loading, after a while of loading it give me this error:

 Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager.

here is a photo:

enter image description here

I have already run react-native link react-native-webview, it didnt do anything. In my package.jsonI have this:

"react-native-webview": "^10.8.3",

here is the code:

<SafeAreaView style={{flex: 1}}>
  <View style={{flex: 1}}>
    <WebView
      ref={(ref) => setMap_ref(ref)}
      source={{html: openstreet_html}}
    />
    <LocationView address={address} navigation={navigation} />
  </View>
</SafeAreaView>

I have already done everything in this thread as well. I get the same error. Before I pull from master this problem didnt exist. is there anything I have to do?

S. N
  • 3,456
  • 12
  • 42
  • 65
  • Try updating the packages to latest version. Clear the npm cache and node_module folder and try again. It could be due to some packages missing. – Sriram Sep 23 '20 at 12:25
  • @Sriram I delted node_module and platform tools folders and also clear the npm cache but the problem remains the same, it takes a long time loading and then it tells me the same problem after a while. – S. N Sep 23 '20 at 12:40
  • What is the version of the react-native? Did you try upgrading the react-native? – Sriram Sep 23 '20 at 12:58
  • @Sriram react-native-cli: 2.0.1 react-native: n/a - not inside a React Native project directory, – S. N Sep 23 '20 at 13:06
  • @Sriram how can I upgrade? – S. N Sep 23 '20 at 13:06
  • Could you please provide the content of package.json. Based on that I can modify the json file for your use or I can suggest you the method to upgrade. – Sriram Sep 23 '20 at 13:17
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/221942/discussion-between-sriram-and-s-n). – Sriram Sep 23 '20 at 13:19

2 Answers2

0
gradlew --stop 

then Clear the project, and run again with:

react-native run-android --port=8082

this worked for me thanks to @Sriram.

S. N
  • 3,456
  • 12
  • 42
  • 65
0

some time react-native link not link the library . try manually link the webview. you can follow these steps to link the webview to android. https://engineering.brigad.co/demystifying-react-native-modules-linking-964399ec731b