Fix missing webview provider crash on Android #1
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
I applied the changes requested in this PR: facebook#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 facebook#24533 but facebook#26189 (added in 0.62) reverted the fix
Indeed the exception raised in Crashlytics is actually a
AndroidRuntimeException
andMissingWebViewPackageException
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 inMissingWebViewPackageException
But following that reasoning, I am not sure facebook#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
Test Plan
I created a version of react native with this patch applied
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.