question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebView on Android Crashes Randomly

See original GitHub issue

WebView on Android crashes sometimes in a strange way. The app keeps working normally however the WebView is not loaded and onError does not get called. Is there a way to handle this and reload the WebView.

To Reproduce: I haven’t found a way to reproduce the issue since it happens very randomly but is annoying because you have to restart the app.

Expected behavior: The WebView should keep running normally.

Screenshots/Videos: Here is the crashlog. onError is not fired either.

01-07 18:08:56.840 25270 25270 W cr_AwContents: Application attempted to call on a destroyed WebView
01-07 18:08:56.840 25270 25270 W cr_AwContents: java.lang.Throwable
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at org.chromium.android_webview.AwContents.p(chromium-TrichromeWebViewGoogle.aab-stable-428010133:2)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at org.chromium.android_webview.AwContents.h(chromium-TrichromeWebViewGoogle.aab-stable-428010133:1)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.android.webview.chromium.WebViewChromium.evaluateJavaScript(chromium-TrichromeWebViewGoogle.aab-stable-428010133:8)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.webkit.WebView.evaluateJavascript(WebView.java:911)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager$f.a(Unknown Source:7)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager.receiveCommand(Unknown Source:114)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager.receiveCommand(Unknown Source:2)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.NativeViewHierarchyManager.dispatchCommand(Unknown Source:18)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$DispatchCommandOperation.execute(Unknown Source:12)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$1.run(Unknown Source:140)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(Unknown Source:53)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(Unknown Source:0)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(Unknown Source:31)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(Unknown Source:0)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(Unknown Source:46)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(Unknown Source:2)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1055)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.view.Choreographer.doCallbacks(Choreographer.java:875)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.view.Choreographer.doFrame(Choreographer.java:772)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.os.Handler.handleCallback(Handler.java:900)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.os.Handler.dispatchMessage(Handler.java:103)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.os.Looper.loop(Looper.java:219)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at android.app.ActivityThread.main(ActivityThread.java:8347)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at java.lang.reflect.Method.invoke(Native Method)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
01-07 18:08:56.840 25270 25270 W cr_AwContents:         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
01-07 18:08:56.842 25270 25270 I chatty  : uid=10312(com.streetwriters.notesnook) identical 3 lines
01-07 18:08:56.854 25270 25270 W cr_AwContents: Application attempted to call on a destroyed WebView
01-07 18:08:56.854 25270 25270 W cr_AwContents: java.lang.Throwable
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at org.chromium.android_webview.AwContents.p(chromium-TrichromeWebViewGoogle.aab-stable-428010133:2)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at org.chromium.android_webview.AwContents.h(chromium-TrichromeWebViewGoogle.aab-stable-428010133:1)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.android.webview.chromium.WebViewChromium.evaluateJavaScript(chromium-TrichromeWebViewGoogle.aab-stable-428010133:8)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.webkit.WebView.evaluateJavascript(WebView.java:911)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager$f.a(Unknown Source:7)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager.receiveCommand(Unknown Source:114)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager.receiveCommand(Unknown Source:2)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.NativeViewHierarchyManager.dispatchCommand(Unknown Source:18)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$DispatchCommandOperation.execute(Unknown Source:12)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$1.run(Unknown Source:140)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(Unknown Source:53)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(Unknown Source:0)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(Unknown Source:31)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(Unknown Source:0)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(Unknown Source:46)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(Unknown Source:2)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1055)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.view.Choreographer.doCallbacks(Choreographer.java:875)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.view.Choreographer.doFrame(Choreographer.java:772)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.os.Handler.handleCallback(Handler.java:900)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.os.Handler.dispatchMessage(Handler.java:103)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.os.Looper.loop(Looper.java:219)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at android.app.ActivityThread.main(ActivityThread.java:8347)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at java.lang.reflect.Method.invoke(Native Method)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
01-07 18:08:56.854 25270 25270 W cr_AwContents:         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
01-07 18:08:56.855  1275  8936 E InputDispatcher: Window handle recents_animation_input_consumer has no registered input channel
01-07 18:08:56.855  1275  8936 I chatty  : uid=1000(system) Binder:1275_1B identical 2 lines
01-07 18:08:56.855  1275  8936 E InputDispatcher: Window handle recents_animation_input_consumer has no registered input channel
01-07 18:08:56.888 25270 25270 W cr_AwContents: Application attempted to call on a destroyed WebView
01-07 18:08:56.888 25270 25270 W cr_AwContents: java.lang.Throwable
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at org.chromium.android_webview.AwContents.p(chromium-TrichromeWebViewGoogle.aab-stable-428010133:2)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at org.chromium.android_webview.AwContents.h(chromium-TrichromeWebViewGoogle.aab-stable-428010133:1)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.android.webview.chromium.WebViewChromium.evaluateJavaScript(chromium-TrichromeWebViewGoogle.aab-stable-428010133:8)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.webkit.WebView.evaluateJavascript(WebView.java:911)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager$f.a(Unknown Source:7)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager.receiveCommand(Unknown Source:114)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.reactnativecommunity.webview.RNCWebViewManager.receiveCommand(Unknown Source:2)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.NativeViewHierarchyManager.dispatchCommand(Unknown Source:18)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$DispatchCommandOperation.execute(Unknown Source:12)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$1.run(Unknown Source:140)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(Unknown Source:53)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(Unknown Source:0)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(Unknown Source:31)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(Unknown Source:0)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(Unknown Source:46)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(Unknown Source:2)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1055)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.view.Choreographer.doCallbacks(Choreographer.java:875)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.view.Choreographer.doFrame(Choreographer.java:772)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.os.Handler.handleCallback(Handler.java:900)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.os.Handler.dispatchMessage(Handler.java:103)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.os.Looper.loop(Looper.java:219)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at android.app.ActivityThread.main(ActivityThread.java:8347)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at java.lang.reflect.Method.invoke(Native Method)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
01-07 18:08:56.888 25270 25270 W cr_AwContents:         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

Environment:

  • OS: Android
  • OS version: All versions
  • react-native version: 0.63.4
  • react-native-webview version: v11.0.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15

github_iconTop GitHub Comments

29reactions
lcaccavarocommented, Feb 26, 2021

A new update…

I found that there is androidHardwareAccelerationDisabled prop in webview that resolved my problem and does not impact the rest of application.

5reactions
rdgoutiyamacommented, Mar 17, 2021

Here, when I have vimeo or youtube video embedded, using androidHardwareAccelerationDisabled={false} crashes sometimes with android 10.

Using androidHardwareAccelerationDisabled={true} not crashes, but vimeo or youtube video not show image, only audio.

My react-native-webview version is 11.2.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apps crashing w/ Android 12 Beta? WebView is the issue
If you are encountering issues with app crashes and are running the latest Android 12 Beta, your problem could be Android System WebView....
Read more >
Here's why your Android apps were randomly crashing last ...
Last month, Android apps were randomly crashing on users' devices thans to WebView. Now, Google has issued a statement with further details.
Read more >
PSA: Random app crashes today? Uninstall Android Webview ...
This doesn't fully uninstall webview, it only uninstalls the most recent update. But this will get your phone working normally again.
Read more >
Fix Android Apps Crashing With Android System Webview
Recently a lot of Android users reported that the apps have been crashing on their devices. Google has also released a statement that ......
Read more >
Fixed with update] Google confirms an issue with WebView is ...
Google has shared an update regarding the app crashing issue: We have resolved the issue with WebView that caused some apps on Android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found