Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIGRATED: App crashes on startup on select environments (Samsung + Android 7 + outdated system WebView) (#18322) #14

Closed
jamonholmgren opened this issue Sep 10, 2018 · 8 comments
Labels
migrated Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+

Comments

@jamonholmgren
Copy link
Member

MIgrated from facebook/react-native#18322

@semekh says:


We were seeing a notable amount of crashes on Samsung devices, and after getting hold of a device that kept crashing, we realized that even a freshly react-native inited project crashes on startup.

Environment
Environment:
OS: Linux 4.15
Node: 9.8.0
Yarn: 1.5.1
npm: 5.7.1
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.1 => 0.54.1
According to our crash reporter, the crash is limited to Samsung devices running Android 7.0.0.
On these devices, "Android WebView Implementation" is installed with version 0.0.0.1 which looks suspicious.

Workaround
Updating Android WebView Implementation from Play Store fixes the issue.

Stacktrace

android.webkit.MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
    at android.webkit.WebViewFactory.getWebViewContextAndSetProvider(WebViewFactory.java:270)
    at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:330)
    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:194)
    at android.webkit.CookieManager.getInstance(CookieManager.java:39)
    at com.facebook.react.modules.network.ForwardingCookieHandler.getCookieManager(ForwardingCookieHandler.java:158)
    at com.facebook.react.modules.network.ForwardingCookieHandler.get(ForwardingCookieHandler.java:56)
    at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:59)
    at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:40)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
    at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:371)
    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:194)
    at android.webkit.CookieManager.getInstance(CookieManager.java:39)
    at com.facebook.react.modules.network.ForwardingCookieHandler.getCookieManager(ForwardingCookieHandler.java:158)
    at com.facebook.react.modules.network.ForwardingCookieHandler.get(ForwardingCookieHandler.java:56)
    at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:59)
    at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:40)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)

More info on original issue thread

@jamonholmgren jamonholmgren added the migrated Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+ label Sep 10, 2018
@hzz780
Copy link

hzz780 commented Sep 28, 2018

Failed to load WebView provider: No WebView installed

emmmm, maybe you choose the wrong image.

Please use Google APIs Intel x86 Atom_64 System Image
Please use Google APIs Intel x86 Atom_64 System Image
Please use Google APIs Intel x86 Atom_64 System Image

image

@hzz780

This comment has been minimized.

ankur-sardar added a commit to lunascape/react-native-webview that referenced this issue Oct 25, 2018
@Ehesp
Copy link

Ehesp commented Apr 3, 2019

This is currently out of our control. Closing for now, however if a fix is discovered please let us know when a reproduction/PR and we'll investigate further 👍

@nishantWM
Copy link

Shouldn't this be as simple as adding a check for android.software.webview before calling it? There's a suggested way here

@cristianoccazinsp
Copy link
Contributor

Looks like this crash is back (or was never resolved). Any ideas?

1 similar comment
@lfoliveir4
Copy link

Looks like this crash is back (or was never resolved). Any ideas?

@otaviogaiao
Copy link

It's happening to my app too. Any workaround ?

TheAlmightyBob pushed a commit to TheAlmightyBob/react-native-webview that referenced this issue Oct 15, 2022
…bView in view hierarchy

* add support to reuse instance with webViewKey

* change up

* address comments related to layout params

* add nullability checks

* fix

* get full stack trace

* add secondary map

* rename to ifHasInternalWebView

* additional fixes

* fix

* fix boolean

[android] add messaging passing without a react tag (react-native-webview#12)

This PR adds messaging passing. This was much simpler to do than the iOS counter part. This is the analogue to the following PR: discord#6. I've followed the same test plan. The sample app was really nice to use when testing.

In the previous PR discord#11, I broke all native->react-native communication since events were being passed by the `InternalWebView` viewId not the `RNCWebView` viewId. This is now fixed.

[android] check source prop if changed (react-native-webview#14)

* [android] check source prop if changed

* detect if new source is null too
@27leaves
Copy link

I also just got a crashlytics report about this. (using react-native)

Fatal Exception: android.util.AndroidRuntimeException: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
       at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:363)
       at android.webkit.CookieManager.getInstance(CookieManager.java:50)
       at com.facebook.react.modules.network.ForwardingCookieHandler.getCookieManager(ForwardingCookieHandler.java:136)
       at com.facebook.react.modules.network.ForwardingCookieHandler.get(ForwardingCookieHandler.java:53)
       at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:47)
       at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44)
       at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
       at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
       at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
       at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at java.lang.Thread.run(Thread.java:1012)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+
Projects
None yet
Development

No branches or pull requests

8 participants