WebView on Android Crashes Randomly
See original GitHub issueWebView 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:
- Created 3 years ago
- Comments:15
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A new update…
I found that there is androidHardwareAccelerationDisabled prop in webview that resolved my problem and does not impact the rest of application.
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