Reputation: 1
I'm encountering a crash in my Android application when attempting to inflate a WebView in a fragment. My device is HUAWEI Y6 Prime 2018 .Here's the stack trace:
java.lang.RuntimeException: android.view.InflateException: Binary XML file line #120: Binary XML file line #120: Error inflating class <unknown>
at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4690)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4649)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4623)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4575)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2006)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: android.view.InflateException: Binary XML file line #120: Binary XML file line #120: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #120: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:658)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:64)
at com.android.internal.policy.HwPhoneLayoutInflater.onCreateView(HwPhoneLayoutInflater.java:107)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:731)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:799)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:874)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at androidx.databinding.DataBindingUtil.inflate(DataBindingUtil.java:126)
at androidx.databinding.ViewDataBinding.inflateInternal(ViewDataBinding.java:1409)
at ir.mservices.mybook.databinding.FragmentWebviewBinding.inflate(FragmentWebviewBinding.java:121)
at ir.mservices.mybook.databinding.FragmentWebviewBinding.inflate(FragmentWebviewBinding.java:107)
at ir.mservices.mybook.fragments.WebViewFragment.onCreateView(WebViewFragment.java:144)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3114)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:557)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1455)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3034)
at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:2970)
at androidx.fragment.app.FragmentController.dispatchPause(FragmentController.java:296)
at androidx.fragment.app.FragmentActivity.onPause(FragmentActivity.java:284)
at ir.mservices.mybook.core.MainActivity.onPause(MainActivity.java:580)
at android.app.Activity.performPause(Activity.java:7542)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1420)
at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4672)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4649)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4623)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4575)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2006)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: android.util.AndroidRuntimeException: java.lang.reflect.InvocationTargetException
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:231)
at android.webkit.WebView.getFactory(WebView.java:2467)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2462)
at android.webkit.WebView.setOverScrollMode(WebView.java:2527)
at android.view.View.<init>(View.java:4552)
at android.view.View.<init>(View.java:4684)
at android.view.ViewGroup.<init>(ViewGroup.java:597)
at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:55)
at android.webkit.WebView.<init>(WebView.java:636)
at android.webkit.WebView.<init>(WebView.java:581)
at android.webkit.WebView.<init>(WebView.java:564)
at android.webkit.WebView.<init>(WebView.java:551)
...
It seems to be related to the WebView implementation. Has anyone encountered this issue before or have any ideas on how to resolve it?
Upvotes: 0
Views: 57