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.

Failed to load WebView provider: No WebView installed android.webkit.WebViewFactory.getProviderClass

See original GitHub issue

Good 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:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:24 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
9Hyeonwoocommented, Feb 15, 2021

I am not sure this issue related with react-native repository. There is a PR to resolve same issue in react-native. If you want to check, here is link to PR I found a way to reproduce this issue and commented on that PR.

After Disable Android System WebView system app, you can get AndroidRuntimeException exception with MissingWebViewPackageException message.

4reactions
tszajna0commented, Dec 9, 2020

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:

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)

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.

Read more comments on GitHub >

github_iconTop 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 >

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