Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.webkit.WebViewFactory$MissingWebViewPackageException from Android 7.0

Tags:

android

crash

The following crash is reported occasionally (rarely), and only from Android 7.0 devices:

android.util.AndroidRuntimeException: 
  at android.webkit.WebViewFactory.getProviderClass (WebViewFactory.java:371)
  at android.webkit.WebViewFactory.getProvider (WebViewFactory.java:194)
  at android.webkit.WebViewDatabase.getInstance (WebViewDatabase.java:38)
  at com.amazon.device.ads.AdLayout.isWebViewDatabaseNull (SourceFile:352)
  at com.amazon.device.ads.AdLayout.initializeIfNecessary (SourceFile:260)
  at com.amazon.device.ads.AdLayout.getAdController (SourceFile:303)
  at com.amazon.device.ads.AdLayout.onLayout (SourceFile:478)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.RelativeLayout.onLayout (RelativeLayout.java:1189)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.RelativeLayout.onLayout (RelativeLayout.java:1189)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1982)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1826)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1735)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:383)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:321)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:383)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:321)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1982)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1826)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1735)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:383)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:321)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1982)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1826)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1735)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:383)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:321)
  at com.android.internal.policy.DecorView.onLayout (DecorView.java:751)
  at android.view.View.layout (View.java:17838)
  at android.view.ViewGroup.layout (ViewGroup.java:5754)
  at android.view.ViewRootImpl.performLayout (ViewRootImpl.java:2698)
  at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2371)
  at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1462)
  at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:6960)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:907)
  at android.view.Choreographer.doCallbacks (Choreographer.java:709)
  at android.view.Choreographer.doFrame (Choreographer.java:644)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:893)
  at android.os.Handler.handleCallback (Handler.java:836)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:208)
  at android.app.ActivityThread.main (ActivityThread.java:6267)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1063)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:924)
Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: 
  at android.webkit.WebViewFactory.getWebViewContextAndSetProvider (WebViewFactory.java:270)
  at android.webkit.WebViewFactory.getProviderClass (WebViewFactory.java:330)

The stack trace does not contain anything related to the app, so I do not know where to look into this. Could anyone shed some light on this? How to prevent this?

like image 672
Hong Avatar asked Sep 18 '17 11:09

Hong


1 Answers

This is due to that the Webview is updated via google play at the same time as you try to use it in your application.

More info here: https://bugs.chromium.org/p/chromium/issues/detail?id=506369

like image 102
Magnus Avatar answered Nov 14 '22 22:11

Magnus