Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

my application is on Google Play and it runs fine on most of devices (thousands of users). But in rare cases (fraction of percent of daily active users) I get Error inflating class android.webkit.WebView when I inflate layout for my fragment in onCreateView method. Full stack trace is following:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tapmedia.tapito/com.tapmedia.tapito.LockscreenActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class android.webkit.WebView
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2694)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2759)
   at android.app.ActivityThread.access$900(ActivityThread.java:178)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:145)
   at android.app.ActivityThread.main(ActivityThread.java:5944)
   at java.lang.reflect.Method.invoke(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class android.webkit.WebView
   at android.view.LayoutInflater.createView(LayoutInflater.java:640)
   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:689)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:748)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
   at com.tapmedia.tapito.WebViewFragment.onCreateView(SourceFile:84)
   at android.support.v4.app.Fragment.performCreateView(SourceFile:1789)
   at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:924)
   at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1116)
   at android.support.v4.app.FragmentManagerImpl.onCreateView(SourceFile:2196)
   at android.support.v4.app.FragmentActivity.onCreateView(SourceFile:300)
   at android.support.v7.app.AppCompatDelegateImplV7.callActivityOnCreateView(SourceFile:838)
   at android.support.v7.app.AppCompatDelegateImplV11.callActivityOnCreateView(SourceFile:34)
   at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(SourceFile:826)
   at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(SourceFile:44)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:732)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
   at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:249)
   at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:106)
   at com.tapmedia.tapito.LockscreenActivity.onCreate(SourceFile:103)
   at android.app.Activity.performCreate(Activity.java:6289)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2647)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2759)
   at android.app.ActivityThread.access$900(ActivityThread.java:178)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:145)
   at android.app.ActivityThread.main(ActivityThread.java:5944)
   at java.lang.reflect.Method.invoke(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Constructor.newInstance(Constructor.java)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
   at android.view.LayoutInflater.createView(LayoutInflater.java:614)
   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:689)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:748)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
   at com.tapmedia.tapito.WebViewFragment.onCreateView(SourceFile:84)
   at android.support.v4.app.Fragment.performCreateView(SourceFile:1789)
   at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:924)
   at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1116)
   at android.support.v4.app.FragmentManagerImpl.onCreateView(SourceFile:2196)
   at android.support.v4.app.FragmentActivity.onCreateView(SourceFile:300)
   at android.support.v7.app.AppCompatDelegateImplV7.callActivityOnCreateView(SourceFile:838)
   at android.support.v7.app.AppCompatDelegateImplV11.callActivityOnCreateView(SourceFile:34)
   at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(SourceFile:826)
   at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(SourceFile:44)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:732)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
   at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:249)
   at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:106)
   at com.tapmedia.tapito.LockscreenActivity.onCreate(SourceFile:103)
   at android.app.Activity.performCreate(Activity.java:6289)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2647)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2759)
   at android.app.ActivityThread.access$900(ActivityThread.java:178)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:145)
   at android.app.ActivityThread.main(ActivityThread.java:5944)
   at java.lang.reflect.Method.invoke(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
   at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:161)
   at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:101)
   at android.webkit.WebView.getFactory(WebView.java:2193)
   at android.webkit.WebView.ensureProviderCreated(WebView.java:2188)
   at android.webkit.WebView.setOverScrollMode(WebView.java:2247)
   at android.view.View.(View.java:3795)
   at android.view.View.(View.java:3909)
   at android.view.ViewGroup.(ViewGroup.java:507)
   at android.widget.AbsoluteLayout.(AbsoluteLayout.java:55)
   at android.webkit.WebView.(WebView.java:547)
   at android.webkit.WebView.(WebView.java:492)
   at android.webkit.WebView.(WebView.java:475)
   at android.webkit.WebView.(WebView.java:462)
   at java.lang.reflect.Constructor.newInstance(Constructor.java)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
   at android.view.LayoutInflater.createView(LayoutInflater.java:614)
   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:689)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:748)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
   at com.tapmedia.tapito.WebViewFragment.onCreateView(SourceFile:84)
   at android.support.v4.app.Fragment.performCreateView(SourceFile:1789)
   at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:924)
   at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1116)
   at android.support.v4.app.FragmentManagerImpl.onCreateView(SourceFile:2196)
   at android.support.v4.app.FragmentActivity.onCreateView(SourceFile:300)
   at android.support.v7.app.AppCompatDelegateImplV7.callActivityOnCreateView(SourceFile:838)
   at android.support.v7.app.AppCompatDelegateImplV11.callActivityOnCreateView(SourceFile:34)
   at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(SourceFile:826)
   at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(SourceFile:44)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:732)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
   at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:249)
   at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:106)
   at com.tapmedia.tapito.LockscreenActivity.onCreate(SourceFile:103)
   at android.app.Activity.performCreate(Activity.java:6289)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)

   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2647)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2759)
   at android.app.ActivityThread.access$900(ActivityThread.java:178)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:145)
   at android.app.ActivityThread.main(ActivityThread.java:5944)
   at java.lang.reflect.Method.invoke(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
   at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:137)
   at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:133)
   at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:101)
   at android.webkit.WebView.getFactory(WebView.java:2193)
   at android.webkit.WebView.ensureProviderCreated(WebView.java:2188)
   at android.webkit.WebView.setOverScrollMode(WebView.java:2247)
   at android.view.View.(View.java:3795)
   at android.view.View.(View.java:3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
117 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you see these reports from devices running Android Lollipop, please ignore them. This likely happens whenever something launches an activity that uses WebView while the WebView package is in the middle of being updated by Play Store (which can only happen on Lollipop currently). During updates, packages are treated as not installed by the package manager. That is, there is nothing wrong with your app. The time window while the updated package is considered non-existent is typically small, so when the app is relaunched after such a crash, it will start normally.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...