From 9e0d8696cc68436a0d309cafde252c55fc337be4 Mon Sep 17 00:00:00 2001 From: Rachit Mishra Date: Fri, 20 May 2022 04:28:31 -0700 Subject: [PATCH] fix: crash while loading webview (#33867) Summary: This will fix a crash on Motorola devices on Android 7, where WebView fails to load due to initialisation issues in the WebViewChromiumFactoryProvider (Caused by org.chromium.base.library_loader.ProcessInitException). ## Changelog [Android][Fix] - Exception with `Cannot load WebView` message will initialising WebView (along with existing checks) Pull Request resolved: https://github.com/facebook/react-native/pull/33867 Test Plan: Screenshot 2022-05-19 at 02 21 57 Reviewed By: javache Differential Revision: D36517673 Pulled By: cortinico fbshipit-source-id: 4fa5b903529eb04d01ed8fa540cbd883224e8e62 --- .../react/modules/network/ForwardingCookieHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java b/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java index ecc92ac69b0cbe..def2f4e3957e0d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java @@ -151,7 +151,8 @@ protected void doInBackgroundGuarded(Void... params) { if (exception.getClass().getCanonicalName().contains("MissingWebViewPackageException") || (message != null && (message.contains("WebView provider") - || message.contains("No WebView installed")))) { + || message.contains("No WebView installed") + || message.contains("Cannot load WebView")))) { return null; } else { throw exception;