keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
381 stars 106 forks source link

bug(android): lack of handling when WebView provider unavailable #11560

Open sentry-io[bot] opened 1 month ago

sentry-io[bot] commented 1 month ago

Sentry Issue: KEYMAN-ANDROID-5E9

WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
    at android.webkit.WebViewFactory.getWebViewContextAndSetProvider(WebViewFactory.java:463)
    at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:528)
    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:369)
    at android.webkit.WebView.getFactory(WebView.java:2606)
    at android.webkit.WebView.ensureProviderCreated(WebView.java:2600)
...
(25 additional frame(s) were not displayed)

AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
    at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:570)
    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:369)
    at android.webkit.WebView.getFactory(WebView.java:2606)
    at android.webkit.WebView.ensureProviderCreated(WebView.java:2600)
    at android.webkit.WebView.setOverScrollMode(WebView.java:2668)
...
(24 additional frame(s) were not displayed)

AndroidRuntimeException: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:398)
    at android.webkit.WebView.getFactory(WebView.java:2606)
    at android.webkit.WebView.ensureProviderCreated(WebView.java:2600)
    at android.webkit.WebView.setOverScrollMode(WebView.java:2668)
    at android.view.View.<init>(View.java:5745)
...
(23 additional frame(s) were not displayed)

RuntimeException: Unable to create service com.keyman.android.SystemKeyboard: android.util.AndroidRuntimeException: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:5111)
    at android.app.ActivityThread.-$$Nest$mhandleCreateService
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2506)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:230)
...
(5 additional frame(s) were not displayed)
sentry-io[bot] commented 1 month ago

Sentry Issue: KEYMAN-ANDROID-4R3

The message here is notably different:

Failed to verify WebView provider, version code is lower than expected: actual

But the end effect is essentially the same - we can't spin up the Web-based keyboard.

jahorton commented 1 month ago

Related StackOverflow post: https://stackoverflow.com/a/46266199

General hypothesis: if the WebView is in the middle of being updated when the app needs to spin up a keyboard, the WebView provider will be unavailable, triggering a crash.

I'm not immediately finding useful information for the "version code" variant, though at least others have also seen it. Chances are that our handling would need to act similarly, anyway.

jahorton commented 1 month ago

Whoops, slipped up on the tagging there for a moment. The "cloud-downloader state logging" entry in history is irrelevant.

sentry-io[bot] commented 1 month ago

Sentry Issue: KEYMAN-ANDROID-599

This is from 16.0, but occurring from a different location within the code.

jahorton commented 1 month ago

It also appears that a lot of the ApplicationNotResponding Sentry reports also intersect with WebView-related code paths. (Technically, it seems to always occur where inter-process communication may be involved.)

From 17.0:

From 16.0: