Android App using WebView crashes when Android System Webview is updated
Reported by
jared.bl...@usaa.com,
Jul 1 2015
|
|||
Issue descriptionSteps to reproduce the problem: 1. Uninstall updates to Android System Webview via Settings --> Apps 2. Launch application dependent on WebView (eg. https://play.google.com/store/apps/details?id=com.usaa.mobile.android.usaa) 3. Launch Play Store, start update of Android System Webview 4. Switch task back to app launched in 2. What is the expected behavior? Application continues to function before, during, and after WebView is updated. What went wrong? Screen flashes black as app process is stopped and restarted, then application crashes with "Unfortunately, USAA has stopped." Relevant logcat snippet: 07-01 17:07:25.132 21637-21637/? E/WebViewFactory﹕ Failed to list WebView package libraries for loadNativeLibrary android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:281) at android.webkit.WebViewFactory.getWebViewNativeLibraryPaths(WebViewFactory.java:282) at android.webkit.WebViewFactory.loadNativeLibrary(WebViewFactory.java:397) at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:103) at android.webkit.CookieManager.getInstance(CookieManager.java:42) at com.usaa.securehttp.y.a(SourceFile:117) at com.usaa.mobile.android.inf.application.BaseApplicationSession.onCreate(SourceFile:128) at com.usaa.mobile.android.app.core.session.ApplicationSession.onCreate(SourceFile:109) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 07-01 17:07:25.134 21637-21637/? E/WebViewFactory﹕ Chromium WebView package does not exist android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:114) at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:146) at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:109) at android.webkit.CookieManager.getInstance(CookieManager.java:42) at com.usaa.securehttp.y.a(SourceFile:117) at com.usaa.mobile.android.inf.application.BaseApplicationSession.onCreate(SourceFile:128) at com.usaa.mobile.android.app.core.session.ApplicationSession.onCreate(SourceFile:109) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 07-01 17:07:26.080 21637-21637/com.usaa.mobile.android.usaa E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.usaa.mobile.android.usaa, PID: 21637 java.lang.RuntimeException: Unable to create application com.usaa.mobile.android.app.core.session.ApplicationSession: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4556) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:174) at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:109) at android.webkit.CookieManager.getInstance(CookieManager.java:42) at com.usaa.securehttp.y.a(SourceFile:117) at com.usaa.mobile.android.inf.application.BaseApplicationSession.onCreate(SourceFile:128) at com.usaa.mobile.android.app.core.session.ApplicationSession.onCreate(SourceFile:109) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:114) at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:146) at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:109) at android.webkit.CookieManager.getInstance(CookieManager.java:42) at com.usaa.securehttp.y.a(SourceFile:117) at com.usaa.mobile.android.inf.application.BaseApplicationSession.onCreate(SourceFile:128) at com.usaa.mobile.android.app.core.session.ApplicationSession.onCreate(SourceFile:109) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 07-01 17:07:26.084 1224-1224/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid parameter app 07-01 17:07:26.084 1224-1224/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid package name : Perhaps you didn't include a PendingIntent in the extras? 07-01 17:07:27.438 17776-21808/? E/AppIncrementalLogger﹕ No apps are found for package name 'com.google.android.webview' 07-01 17:07:28.055 21834-21834/? E/SysUtils﹕ ApplicationContext is null in ApplicationStatus 07-01 17:07:28.206 1224-1224/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid parameter app 07-01 17:07:28.206 1224-1224/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid package name : Perhaps you didn't include a PendingIntent in the extras? Did this work before? No Chrome version: 43.0.2357.121 Channel: stable OS Version: 5.1.1 Flash Version: This crash surfaced in our crash analytics tool, where it has been reported on a wide array of phones running all versions of Lollipop. I've been able to reproduce it on a Nexus 5 running 5.1.1 and a Galaxy Note 3 running 5.0.
,
Jul 6 2015
,
Jul 7 2015
We're working with the framework and play store teams to try and improve the handling of updates of in-use apks, but unfortunately we can't do anything about this in webview; it's just a normal APK and this behaviour is the normal behaviour of updates on android: during the update, the package does not count as installed and so attempts to look it up in the package manager will fail. This should only cause crashes if the app actually gets launched during the update window. The activity manager cleanly shuts down applications that are using webview before the update starts (through the normal lifecycle, not a crash). Unfortunately the system doesn't know which apps are going to use webview later in their execution (this is tracked at runtime, once the webview code is actually loaded into the process) so is not able to prevent them from being launched again, and if the update isn't finished yet when that happens it will fail :/
,
Jul 7 2015
Absolutely agree that this isn't an issue with webview per-se, but an issue with the activity manager itself; that said, we were asked to open this ticket here instead of the android issue tracker (see #1 for the original submission). I can move it back to the other issue tracker with more details, if that is more appropriate... At the time of the crash (while the update to webview is going on), our application is in the foreground. It is shut down by the activity manager and then restarted (which is a good thing, since it was the foreground application), ostensibly by the activity manager. I can only imagine that the activity manager is restarting the application too early (before webview is fully installed), resulting in a crash.
,
Jul 7 2015
I haven't seen apps be automatically restarted; normally the foreground app just vanishes with no explanation and leaves the user on the launcher (or the underlying activity in the current task) instead. Not a great UX, but doesn't directly cause this crash without further user interaction. Of course, when it vanishes with no explanation, the user is likely to try to relaunch it anyway, since presumably they were using the app, so it doesn't make much practical difference probably :/ Actually fixing this would require changes to how package installation works to make there be a smooth transition from the old to new version without a gap where neither version is available, which isn't how the package manager currently works (which would be a framework issue in android). A mitigation would be for the play store to try to update things when the user isn't using the device. So yeah, if this is going to be discussed anywhere the AOSP bugtracker is more appropriate since neither of those belong to chromium.
,
Jul 9 2015
I met this problem, too. I am wondering if it is appropriate to handle it in WebViewFactory.java to catch NameNotFoundException and give a toast to notify users of WebView updating. Or all applications need to handle this case by themselves. But this issue in the Android bug tracker was closed as wrongforum, which is not correct. :(
,
Jul 15 2015
Catching it in WebViewFactory doesn't really help, because we'd just have to rethrow some other exception anyway and the app would still die - we can't pretend that constructing a webview succeeded, and we can't even wait until the webview is ready since in many cases that will take longer than the ANR timeout and so the app will get killed by the framework with an ANR dialog while we are waiting. Until something is done in the framework/play store the only thing that can really be done is having apps handle it themselves :(
,
Jul 15 2015
I agree with #7 that the only way so far is having apps handle it themselves :(
,
Dec 26 2016
I have problem in Google. I don't know can open my other side.pls help me
,
Feb 1 2018
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gms/com.google.android.gms.auth.uiflows.minutemaid.MinuteMaidActivity}: android.util.AndroidRuntimeException: java.lang.reflect.InvocationTargetException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2696)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2757)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1504)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6237)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: android.util.AndroidRuntimeException: java.lang.reflect.InvocationTargetException
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:204)
at android.webkit.CookieManager.getInstance(CookieManager.java:39)
at fxd.a(:com.google.android.gms:0)
at com.google.android.gms.auth.uiflows.addaccount.AbstractBrowserSignInFragment.onCreateView(:com.google.android.gms:0)
at com.google.android.chimera.FragmentProxy.onCreateView(:com.google.android.gms:0)
at fw.a(:com.google.android.gms:5)
at gn.a(:com.google.android.gms:318)
at gn.c(:com.google.android.gms:19)
at gn.a(:com.google.android.gms:210)
at fn.j(:com.google.android.gms:11)
at gn.b(:com.google.android.gms:13)
at gn.a(:com.google.android.gms:119)
at gn.b(:com.google.android.gms:8)
at gn.j(:com.google.android.gms:3)
at gi.b(:com.google.android.gms:0)
at gd.onStart(:com.google.android.gms:4)
at bww.superOnStart(:com.google.android.gms:0)
at com.google.android.chimera.Activity.onStart(:com.google.android.gms:0)
at com.google.android.chimera.Activity.publicOnStart(:com.google.android.gms:0)
at bww.onStart(:com.google.android.gms:2)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1249)
at android.app.Activity.performStart(Activity.java:6873)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
... 9 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:198)
... 31 more
Caused by: java.lang.RuntimeException: Cannot load WebView
at com.android.webview.chromium.WebViewChromiumFactoryProvider.initialize(WebViewChromiumFactoryProvider.java:5068)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.<init>(WebViewChromiumFactoryProvider.java:197)
... 34 more
Caused by: org.chromium.base.library_loader.ProcessInitException
at org.chromium.base.library_loader.LibraryLoader.loadAlreadyLocked(LibraryLoader.java:336)
at org.chromium.base.library_loader.LibraryLoader.loadNowOverrideApplicationContext(LibraryLoader.java:181)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.initialize(WebViewChromiumFactoryProvider.java:5165)
... 35 more
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/system/app/Chrome/Chrome.apk!/lib/armeabi-v7a/libmonochrome.so" is 32-bit instead of 64-bit
at java.lang.Runtime.loadLibrary0(Runtime.java:977)
at java.lang.System.loadLibrary(System.java:1530)
at org.chromium.base.library_loader.LibraryLoader.loadAlreadyLocked(LibraryLoader.java:318)
... 37 more
,
Apr 4 2018
Fatal Exception: java.lang.RuntimeException: Package not found: com.google.android.webview
at android.webkit.WebViewDelegate.getPackageId(WebViewDelegate.java:164)
at com.android.webview.chromium.WebViewDelegateFactory$ProxyDelegate.getPackageId(WebViewDelegateFactory.java:16)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.startChromiumLocked(WebViewChromiumFactoryProvider.java:177)
at com.android.webview.chromium.WebViewChromiumFactoryProvider$1.run(WebViewChromiumFactoryProvider.java:3)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
,
Nov 27
Hi torne , Is that issue is fixed.
,
Nov 27
Fatal Exception: java.lang.RuntimeException: Package not found: com.google.android.webview
at android.webkit.WebViewDelegate.getPackageId(WebViewDelegate.java:164)
at com.android.webview.chromium.WebViewDelegateFactory$ProxyDelegate.getPackageId(WebViewDelegateFactory.java:16)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.startChromiumLocked(WebViewChromiumFactoryProvider.java:177)
at com.android.webview.chromium.WebViewChromiumFactoryProvider$1.run(WebViewChromiumFactoryProvider.java:3)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
|
|||
►
Sign in to add a comment |
|||
Comment 1 by jared.bl...@usaa.com
, Jul 1 2015