react-native-webview: webview not working on Android 10

Since the new update of API 29 Android 10 in December 2019, react-native-webview is not working on Android 10.

Bug description: White screen on the view

To Reproduce: <View style={{flex: 1}}> <WebView style={{flex: 1}} startInLoadingState scalesPageToFit javaScriptEnabled source={{ uri: RestConstant.grafanaLink + this.state.username, headers: { Authorization: 'Bearer ' + this.state.token, }, }} originWhitelist={['*']} domStorageEnabled={true} ignoreSslError={true} renderError={e => { return this.renderError(); }} /> </View>

Expected behavior: Show the webview from url on iOS Screen Shot 2020-02-10 at 10 58 03

Screenshots/Videos: White screen and loop loading on Android Nexus 5 API 29 Screen Shot 2020-02-10 at 11 04 30

Environment:

  • OS: Android
  • OS version: 10
  • react-native version: 0.61.2
  • react-native-webview version: ^7.4.3

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 12
  • Comments: 33 (1 by maintainers)

Most upvoted comments

same problem… need solution…

Same problem, need solution for this bugs. Happen in Samsung Galaxy Note 10

same problem +1

Same problem with me, it is showing a blank sceen when I load a url, I have android 10, I am using Android Studio.

Same here, our users report crashes with Android 10 (amongst devices there’s a S9).

Sadly, I can’t reproduce it on the emulator and I don’t have any physical device. Does anyone have a clue of what’s going on? Maybe an exception trace?

Could it be related with Google stopping using Chrome as the WebView handler in Android 10 and switching back to Android System WebView?

For info, I’ve tried updating to 10.1.1 without success.

same problem +1

Encountered this in expo. Fixed it by executing: yarn react-native link react-native-webview