Android WebView is crashing while rendering content with latest update to v90.0.4430.82

Viewed 3615

WebView update v90.0.4430.82

Rendering content inside WebView seems to have some issues. Loading is fine, but displaying on screen is not. It seems that this is random, but consistent. Some URL`s render fine, but others are crashing apps constantly when rendered.

Everything was working fine prior to this update. Iv even rolled back the update from Settings -> Apps -> Android System WebView (on older devices disable Chrome) and again working fine. It seems there is an issue, again, like we saw in March 2020.

Here is the crash report:

E/chromium: [ERROR:aw_browser_terminator.cc(123)] Renderer process (11930) crash detected (code 5).
A/chromium: [FATAL:crashpad_client_linux.cc(667)] Render process (11930)'s crash wasn't handled by all associated  webviews, triggering application crash.
A/libc: Fatal signal 5 (SIGTRAP), code -6 (SI_TKILL) in tid 10907 (oc.showcase.dev), pid 10907 (oc.showcase.dev)
1 Answers

There is an update to WebView to 90.0.4430.91, but for sure this fix will not be introduced until later releases (Beta & Canary do not have this issue fixed yet, but it will be introduced).

The reason for crashing the WebView, and the whole app, is caused by JavaScript code that was injected. Replacing iframe with document.write in the JavaScript fixed the problem, but it is not a long-term solution. The issue with iframe is in the WebView it self.

Also, to prevent crashing the whole app like this, because this crashes are caused when content is rendered in the WebView, you should override onRenderProcessGone in your CustomWebViewClient that extends the WebViewClient. But, again, this solution will prevent rendering issues and crashing the whole app only for API level 26+. There is no similar thing below API 26 thus, this issue will cause crash to the whole app, not just the webView.

Temporary (as lest resort) solution it will be to detect the version code of the WebView, and if is the bugged one (v90.0.4430.82), not to initialize the WebView at all, or inject some other tested URL (HRML with JS) that will not cause crash.

Here you can find bug ticket, description and responses: https://bugs.chromium.org/p/chromium/issues/detail?id=1201228&q=component%3AMobile%3EWebView&can=2

Related