Adds Logic To Catch MissingWebViewPackageException#24533
Closed
thorbenprimke wants to merge 2 commits intofacebook:masterfrom
Closed
Adds Logic To Catch MissingWebViewPackageException#24533thorbenprimke wants to merge 2 commits intofacebook:masterfrom
thorbenprimke wants to merge 2 commits intofacebook:masterfrom
Conversation
5e74f9f to
030b1c2
Compare
…ception Summary: We are seeing crash reports that the webview is missing. In this case it should fail gracefully so that a missing webview does not block from using an app built with React Native. The contains could also be changed to check for "webview" in general to catch all webview related exception. It's currenlty checking on for the specific string that I'm seeing in our app's crashreporting tool.
Contributor
Author
|
@hramos - mind taking a look at this PR? |
cpojer
approved these changes
Apr 24, 2019
Contributor
cpojer
left a comment
There was a problem hiding this comment.
Thanks, this makes sense to me.
facebook-github-bot
approved these changes
Apr 24, 2019
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Collaborator
|
This pull request was successfully merged by @thorbenprimke in 954f715. When will my fix make it into a release? | Upcoming Releases |
grabbou
pushed a commit
that referenced
this pull request
May 6, 2019
Summary: We are seeing crash reports that the webview is missing. In this case it should fail gracefully so that a missing webview does not block from using an app built with React Native. The contains could also be changed to check for "webview" in general to catch all webview related exception. It's currently checking on for the specific string that I'm seeing in our app's crashreporting tool. <img width="1507" alt="Screen Shot 2019-04-19 at 11 26 19 AM" src="https://user-images.githubusercontent.com/741767/56438307-5e1c2f80-6297-11e9-970b-a5095d18e9d7.png"> <img width="935" alt="Screen Shot 2019-04-19 at 11 32 58 AM" src="https://user-images.githubusercontent.com/741767/56438213-fa920200-6296-11e9-8008-5eb344eca8a8.png"> [Android] [Fixed] - The ReactCookieJarContainer/ForwardingCookieHandler now handles the missing WebView gracefully. Pull Request resolved: #24533 Differential Revision: D15062824 Pulled By: cpojer fbshipit-source-id: 80805a47494f0d924b7ee029ce8ca0504eaeee57
facebook-github-bot
referenced
this pull request
Sep 11, 2019
…6189) Summary: We have been experiencing the below crashes in our Flipkart Android app:   Stack overflow thread for the issue that is causing this crash: [https://stackoverflow.com/a/56246743](https://stackoverflow.com/a/56246743) The change I have done is an enhancement on the following PR which got merged to master: [https://github.com/facebook/react-native/pull/24533](https://github.com/facebook/react-native/pull/24533) The exception handling for this crash already exists but it relies on having a specific string in the error message ("Webview not installed"). But the error message for the crashes above does not include this string. I have added a check for all the crashes involving the `MissingWebViewPackageException`. Refer the file: [https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java#102](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java#102) ## Changelog [ANDROID] [Fixed] - The ReactCookieJarContainer/ForwardingCookieHandler now handles all the cases of missing WebView exceptions gracefully. Pull Request resolved: #26189 Test Plan: No new tests have been added. CI should pass. This fix was made based on the exception stacktrace. I have not spent the time to acquire one of the devices that it is happening on. Differential Revision: D17258881 Pulled By: cpojer fbshipit-source-id: 3abb061e345329214025ebab2b3a908f9cce434d
This was referenced Sep 3, 2021
facebook-github-bot
pushed a commit
that referenced
this pull request
Sep 9, 2021
Summary: I applied the changes requested in this PR: #29089 We upgraded to RN 0.62.2 on our latest release and started to see again the "Failed to load WebView provider: No WebView installed" (see below for Crashlytics screenshot)  This crash had been fixed by #24533 but #26189 (added in 0.62) reverted the fix Indeed the exception raised in Crashlytics is actually a `AndroidRuntimeException` and `MissingWebViewPackageException` is only part of the message. For instance, in the screenshot above, the exception message is `android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed` Now these crashes are quite tricky to reproduce, so to be on the safe side, I'm filtering out all exceptions containing `WebView` as suggested by thorbenprimke on the original fix. If my reasoning is correct, it should fix siddhantsoni 's issue as well, since `WebView` is included in `MissingWebViewPackageException` But following that reasoning, I am not sure #26189 fixed siddhantsoni 's issue, so siddhantsoni if you could check that this PR also fixes your issue, that would be great! ## Changelog [Android] [Fixed] - Fix missing WebView provider crash in ForwardingCookieHandler <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> Pull Request resolved: #32165 Test Plan: I created a version of react native with this patch applied ``` "react-native": "almouro/react-native#release/062-2-fix-missing-webview-provider" ``` Before the fix ~0.1% of our users were impacted on Android, no new crashes have occurred after the update. This is putting back what was already in place and working for us, but making the check wider to catch more errors. Reviewed By: lunaleaps Differential Revision: D30847404 Pulled By: sota000 fbshipit-source-id: fe3b5fa2c9ebde5bedd17a9d6394a52ccdbdf0d0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
We are seeing crash reports that the webview is missing. In this case
it should fail gracefully so that a missing webview does not block
from using an app built with React Native.
The contains could also be changed to check for "webview" in general
to catch all webview related exception. It's currently checking on
for the specific string that I'm seeing in our app's crashreporting tool.
Changelog
[Android] [Fixed] - The ReactCookieJarContainer/ForwardingCookieHandler now handles the missing WebView gracefully.
Test Plan
No new tests have been added.
CI should pass.
This fix was made based on the exception stacktrace. I have not spent the time to acquire one of the devices that it is happening on.