It's likely that this is happening in the very short time frame immediately after Lollipop's Android System WebView application updates.
I'd seen this error in the Google Play Dev Console, but also had never been able to reproduce it on my Nexus 5, regardless of how much I really tried to stop my app from having access to the Android System WebView app:
java.lang.RuntimeException: Unable to create application com.uninteresting.app.name:
android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
Then we got word that our app was consistently crashing with the above message on some devices immediately after the System WebView app updates, so I tested that. Still no results, the vanilla Nexus 5 refused to crash our app! So I tried other phones from other manufacturers (roughly 75% of our reports are from Samsung Galaxy devices) and suddenly we were crashing consistently. My testing methodology:
- Open your app, make sure a WebView is showing.
- Open Play Store, navigate to "My Apps," and bring up "Android System
WebView." Uninstall updates. This shouldn't crash you, but you
should see your app force-restart.
- Open your app back up and let it recover from the restart.
- Go back into the Play Store and update Android System WebView.
- Re-focus your app during the update process. Now, if you're on an
affected device, it should crash. If not, your app will just be
pushed to the background and quietly restarted.
A few little caveats with what I've said so far:
- Our app makes the mistake of starting up a WebView extremely early, hence why we get "unable to create application" in our crash message. The user doesn't even have to be looking at our app for it to crash. I doubt this applies to you, but if your app attempts to restart its activity containing a WebView during this scenario, that would explain it.
- 100% of our reports are from 5.0 devices, I have no earthly clue how this could occur on anything below Lollipop.
- We do see reports of Nexus 4 and Nexus 5 with this error, so I don't know why I can't reproduce it on those devices. Might be a separate root cause, but I need to look further into that.
In short, I don't immediately think you're doing anything incorrect with ProGuard or your JavascriptInterface. I'm leaning very strongly toward blaming the firmware as the root cause of the majority of reports, resulting in what should be a smooth update process becoming one that instead causes some apps to outright crash.
Edit: I ran a few more tests and it turns out that all the devices that didn't crash are 5.0 or 5.0.1, while all the devices that did crash were 5.0.2, so I can't comfortably point my finger at OEMs anymore.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…