I have a strange issue, on crashlytics I've gotten a report of this exception happening to 43 users (of over 100k).
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{mypackage/mypackage.MainActivivity}: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
I am guessing maybe the web view was in the middle of an update when it happened?
Thoughts?
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{mypackage/mypackage.MainActivivity}: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
I am guessing maybe the web view was in the middle of an update when it happened?
Thoughts?
- Richard (Torne) ColesModeratorYes, this is caused by the WebView being in the middle of an update when the user interacts with your application, since while the package manager is updating it, it's effectively uninstalled. We are investigating possible options to make this less likely or eliminate it entirely, but unfortunately the WebView's existing API doesn't really have a way for us to signal to the application that WebView is not currently available, so we may not be able to do anything about this until a future version of the Android platform.
The only thing I can think of that you can do for now is to catch the NameNotFoundException and handle it in your app, but the only thing you could really do in general is let the user know that the app won't be usable until the update is complete, sorry :(Apr 7, 2015 - Thanks for the explanation +Richard Coles. I am trapping the exception now but for a browser app trapping it doesn't do much since the app is useless but I do tell the user about it and hopefully they'll try again.Apr 7, 2015
- Richard (Torne) ColesModeratorYeah, sorry about this; we didn't realise this was going to be as noticeable as it is now. We're going to investigate what we can do to reduce/remove this problem in future, but unfortunately we can't promise anything just yet.Apr 7, 2015
- Well not a huge issue, I've only gotten 54 user reports of a much larger daily user count. I guess other people might be affected more.Apr 7, 2015
- Richard (Torne) ColesModeratorIt's probably not a huge issue, no, but it can happen in any WebView-using app, and it will happen to some small fraction of users every time the WebView is updated (the people who happen to launch such an app in the time window in question), so it's something we need to address in the system at some point.Apr 7, 2015
- I just noticed I had a crash as well for this same reason but because of an AdView which uses the WebView. It was with MoPub but I'm only using AdMob as my only ad network so I'm guessing it will be happening to anyone using AdMob.Apr 7, 2015
- Richard (Torne) ColesModeratorYeah, unfortunately this can happen to literally any app which uses WebView if the user happens to interact with it at the wrong time; the only apps where it can't happen are ones that don't use webview at all.Apr 7, 2015