'working on an android project getting RNCWebView was not found error
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:
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?
Solution 1:[1]
gradlew --stop
then Clear the project, and run again with:
react-native run-android --port=8082
this worked for me thanks to @Sriram.
Solution 2:[2]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | S. N |
| Solution 2 | f180362 Asad Ullah |

