Reputation: 114
Bug description: The site that I directed with Webview is opened in the ios simulator, Although not working in the andorid simulator.
To Reproduce:
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
&& my code
Expected behavior:. Work same as ios simulator
Screenshots/Videos:
Environment: - OS: macOS - OS version: 10.15.3 - react-native version: 0.62.2 - react-native-webview version: 10.2.3
Upvotes: 1
Views: 2130
Reputation: 114
there are several solutions that I found for myself. @mlammert
add this code snippet to
\node_modules\react-native webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java
After that in AndroidManifest.xml
add these code snippets.
<uses-permission android:name="android.permission.INTERNET" />
and in the add this one android:usesCleartextTraffic="true">
Upvotes: 0
Reputation: 587
It could be a styles problem, try the following
<View style={{width: '100%', height: '100%', backgroundColor: '#FFF'}}>
...//webview component
</View>
Upvotes: 1