Failed to load WebView provider: No WebView installed android.webkit.WebViewFactory.getProviderClass
See original GitHub issueGood day! Every week my app crashes in the production mode on android devices. Basically it is happening on Xiaomi, Samsung, LGE phones with Android 10.
Bug description: The app crashes in the production mode with an exception: Caused by android.webkit.WebViewFactory$MissingWebViewPackageException Failed to load WebView provider: No WebView installed
To Reproduce: I don’t have steps. Just a crash report from crashlytics.
Caused by android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
at android.webkit.WebViewFactory.getWebViewContextAndSetProvider(WebViewFactory.java:339)
at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:402)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:252)
at android.webkit.CookieManager.getInstance(CookieManager.java:47)
at com.facebook.react.modules.network.ForwardingCookieHandler.getCookieManager(ForwardingCookieHandler.java:180)
at com.facebook.react.modules.network.ForwardingCookieHandler.get(ForwardingCookieHandler.java:58)
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:61)
at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:200)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Expected behavior: The app is not crashes.
Screenshots/Videos: No have, because it is happening in the production mode. I can not catch the crash in the develop mode. I checked many times.
Environment:
- OS: Android
- OS version: Android 10
- react-native version: 0.62.0
- react-native-webview version: 9.2.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:24 (2 by maintainers)
Top Results From Across the Web
android Failed to load WebView provider: No WebView installed
I figured out a probable problem here. As we know that webview has been shipping as a separate app from android 5.0, it...
Read more >A crash happen when use the WebView(61.0.3163.98) on ...
AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed.
Read more >android Failed to load WebView provider - YouTube
Android : android Failed to load WebView provider : No WebView installed [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >Failed to load WebView provider: No WebView installed
Failed to load WebView provider: No WebView installed ... 03:05:31.501 25622 25622 E WebViewFactory: at android.webkit.WebView.getFactory(WebView.java:2530) ...
Read more >Pitfalls in Android WebView Implementation
3) Failed to load WebView provider: No WebView installed (Android Internal ... getProviderClass(WebViewFactory.java:371) at android.webkit.
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
I am not sure this issue related with
react-native
repository. There is a PR to resolve same issue inreact-native
. If you want to check, here is link to PR I found a way to reproduce this issue and commented on that PR.I see it on LG K31 and K51. Not much details, just a trace in crashlytics.
I also have some doubts if this is really a ReactNativeWebView issue, or maybe ReactNative in general. Look at the top of stack trace:
It’s not web view creation, it’s merely the cookie handler. Working hypothesis: ReactNative cookie handling (used for generic network access) has a dependency on system web view in Android. When this web view isn’t available (which isn’t guaranteed, according to stackoverflow in some previous comment), then ReactNative crashes. If I’m right, then https://github.com/facebook/react-native/issues/18322 needs to be reopened.