Récemment, nous avons commencé à voir cette nouvelle entrée dans notre crashlytics qui indique qu'Android ne peut pas trouver le paquet Webview sur le périphérique.
Voici le stacktrace complet (les classes de notre code source ont été remplacées par ....
.:
Fatal Exception: Android.view.InflateException: Binary XML file line #139: Binary XML file line #139: Error inflating class <unknown>
Caused by Android.view.InflateException: Binary XML file line #139: Error inflating class <unknown>
Caused by Java.lang.reflect.InvocationTargetException
at Java.lang.reflect.Constructor.newInstance0(Constructor.Java)
at Java.lang.reflect.Constructor.newInstance(Constructor.Java:430)
at Android.view.LayoutInflater.createView(LayoutInflater.Java:645)
at g.a.a.a.d.a(SourceFile:211)
at g.a.a.a.d.a(SourceFile:20)
at g.a.a.a.d$a.onCreateView(SourceFile:302)
at Android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.Java:189)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:777)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:727)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:858)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:518)
at g.a.a.a.d.inflate(SourceFile:60)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:426)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:377)
at ......(SourceFile:148)
at ......(SourceFile:119)
at ......(SourceFile:28)
at Android.support.v4.view.ViewPager.a(SourceFile:1034)
at Android.support.v4.view.ViewPager.a(SourceFile:1182)
at Android.support.v4.view.ViewPager.c(SourceFile:1116)
at Android.support.v4.view.ViewPager.onMeasure(SourceFile:1642)
at ....(SourceFile:27)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.widget.ScrollView.measureChildWithMargins(ScrollView.Java:1320)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.widget.ScrollView.onMeasure(ScrollView.Java:345)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.support.v4.view.ViewPager.onMeasure(SourceFile:1658)
at Android.view.View.measure(View.Java:20234)
at Android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.Java:825)
at Android.widget.RelativeLayout.onMeasure(RelativeLayout.Java:511)
at Android.view.View.measure(View.Java:20234)
at Android.support.v4.widget.DrawerLayout.onMeasure(SourceFile:1081)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:139)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at com.Android.internal.policy.DecorView.onMeasure(DecorView.Java:716)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewRootImpl.performMeasure(ViewRootImpl.Java:2659)
at Android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.Java:1600)
at Android.view.ViewRootImpl.performTraversals(ViewRootImpl.Java:1873)
at Android.view.ViewRootImpl.doTraversal(ViewRootImpl.Java:1485)
at Android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.Java:7078)
at Android.view.Choreographer$CallbackRecord.run(Choreographer.Java:910)
at Android.view.Choreographer.doCallbacks(Choreographer.Java:712)
at Android.view.Choreographer.doFrame(Choreographer.Java:646)
at Android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.Java:896)
at Android.os.Handler.handleCallback(Handler.Java:836)
at Android.os.Handler.dispatchMessage(Handler.Java:103)
at Android.os.Looper.loop(Looper.Java:203)
at Android.app.ActivityThread.main(ActivityThread.Java:6369)
at Java.lang.reflect.Method.invoke(Method.Java)
at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:1088)
at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:949)
Caused by Android.util.AndroidRuntimeException: Android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
at Android.webkit.WebViewFactory.getProviderClass(WebViewFactory.Java:395)
at Android.webkit.WebViewFactory.getProvider(WebViewFactory.Java:194)
at Android.webkit.WebView.getFactory(WebView.Java:2592)
at Android.webkit.WebView.findAddress(WebView.Java:1958)
at Android.text.util.Linkify.gatherMapLinks(Linkify.Java:599)
at Android.text.util.Linkify.addLinks(Linkify.Java:287)
at Android.widget.TextView.setText(TextView.Java:4474)
at Android.widget.TextView.setText(TextView.Java:4395)
at Android.widget.TextView.<init>(TextView.Java:1472)
at Android.widget.TextView.<init>(TextView.Java:727)
at Android.widget.TextView.<init>(TextView.Java:723)
at me.grantland.widget.AutofitTextView.<init>(SourceFile:25)
at Java.lang.reflect.Constructor.newInstance0(Constructor.Java)
at Java.lang.reflect.Constructor.newInstance(Constructor.Java:430)
at Android.view.LayoutInflater.createView(LayoutInflater.Java:645)
at g.a.a.a.d.a(SourceFile:211)
at g.a.a.a.d.a(SourceFile:20)
at g.a.a.a.d$a.onCreateView(SourceFile:302)
at Android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.Java:189)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:777)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:727)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:858)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:518)
at g.a.a.a.d.inflate(SourceFile:60)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:426)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:377)
at ....(SourceFile:148)
at ....(SourceFile:119)
at ....(SourceFile:28)
at Android.support.v4.view.ViewPager.a(SourceFile:1034)
at Android.support.v4.view.ViewPager.a(SourceFile:1182)
at Android.support.v4.view.ViewPager.c(SourceFile:1116)
at Android.support.v4.view.ViewPager.onMeasure(SourceFile:1642)
at ....(SourceFile:27)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.widget.ScrollView.measureChildWithMargins(ScrollView.Java:1320)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.widget.ScrollView.onMeasure(ScrollView.Java:345)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.support.v4.view.ViewPager.onMeasure(SourceFile:1658)
at Android.view.View.measure(View.Java:20234)
at Android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.Java:825)
at Android.widget.RelativeLayout.onMeasure(RelativeLayout.Java:511)
at Android.view.View.measure(View.Java:20234)
at Android.support.v4.widget.DrawerLayout.onMeasure(SourceFile:1081)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:139)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at com.Android.internal.policy.DecorView.onMeasure(DecorView.Java:716)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewRootImpl.performMeasure(ViewRootImpl.Java:2659)
at Android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.Java:1600)
at Android.view.ViewRootImpl.performTraversals(ViewRootImpl.Java:1873)
at Android.view.ViewRootImpl.doTraversal(ViewRootImpl.Java:1485)
at Android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.Java:7078)
at Android.view.Choreographer$CallbackRecord.run(Choreographer.Java:910)
at Android.view.Choreographer.doCallbacks(Choreographer.Java:712)
at Android.view.Choreographer.doFrame(Choreographer.Java:646)
at Android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.Java:896)
at Android.os.Handler.handleCallback(Handler.Java:836)
at Android.os.Handler.dispatchMessage(Handler.Java:103)
at Android.os.Looper.loop(Looper.Java:203)
at Android.app.ActivityThread.main(ActivityThread.Java:6369)
at Java.lang.reflect.Method.invoke(Method.Java)
at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:1088)
at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:949)
Caused by Android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
at Android.webkit.WebViewFactory.getWebViewContextAndSetProvider(WebViewFactory.Java:294)
at Android.webkit.WebViewFactory.getProviderClass(WebViewFactory.Java:354)
at Android.webkit.WebViewFactory.getProvider(WebViewFactory.Java:194)
at Android.webkit.WebView.getFactory(WebView.Java:2592)
at Android.webkit.WebView.findAddress(WebView.Java:1958)
at Android.text.util.Linkify.gatherMapLinks(Linkify.Java:599)
at Android.text.util.Linkify.addLinks(Linkify.Java:287)
at Android.widget.TextView.setText(TextView.Java:4474)
at Android.widget.TextView.setText(TextView.Java:4395)
at Android.widget.TextView.<init>(TextView.Java:1472)
at Android.widget.TextView.<init>(TextView.Java:727)
at Android.widget.TextView.<init>(TextView.Java:723)
at me.grantland.widget.AutofitTextView.<init>(SourceFile:25)
at Java.lang.reflect.Constructor.newInstance0(Constructor.Java)
at Java.lang.reflect.Constructor.newInstance(Constructor.Java:430)
at Android.view.LayoutInflater.createView(LayoutInflater.Java:645)
at g.a.a.a.d.a(SourceFile:211)
at g.a.a.a.d.a(SourceFile:20)
at g.a.a.a.d$a.onCreateView(SourceFile:302)
at Android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.Java:189)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:777)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:727)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:858)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:861)
at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:821)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:518)
at g.a.a.a.d.inflate(SourceFile:60)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:426)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:377)
at ....(SourceFile:148)
at ....(SourceFile:119)
at ....(SourceFile:28)
at Android.support.v4.view.ViewPager.a(SourceFile:1034)
at Android.support.v4.view.ViewPager.a(SourceFile:1182)
at Android.support.v4.view.ViewPager.c(SourceFile:1116)
at Android.support.v4.view.ViewPager.onMeasure(SourceFile:1642)
at ....(SourceFile:27)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.widget.ScrollView.measureChildWithMargins(ScrollView.Java:1320)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.widget.ScrollView.onMeasure(ScrollView.Java:345)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.support.v4.view.ViewPager.onMeasure(SourceFile:1658)
at Android.view.View.measure(View.Java:20234)
at Android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.Java:825)
at Android.widget.RelativeLayout.onMeasure(RelativeLayout.Java:511)
at Android.view.View.measure(View.Java:20234)
at Android.support.v4.widget.DrawerLayout.onMeasure(SourceFile:1081)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:139)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.Java:1705)
at Android.widget.LinearLayout.measureVertical(LinearLayout.Java:797)
at Android.widget.LinearLayout.onMeasure(LinearLayout.Java:657)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewGroup.measureChildWithMargins(ViewGroup.Java:6249)
at Android.widget.FrameLayout.onMeasure(FrameLayout.Java:214)
at com.Android.internal.policy.DecorView.onMeasure(DecorView.Java:716)
at Android.view.View.measure(View.Java:20234)
at Android.view.ViewRootImpl.performMeasure(ViewRootImpl.Java:2659)
at Android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.Java:1600)
at Android.view.ViewRootImpl.performTraversals(ViewRootImpl.Java:1873)
at Android.view.ViewRootImpl.doTraversal(ViewRootImpl.Java:1485)
at Android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.Java:7078)
at Android.view.Choreographer$CallbackRecord.run(Choreographer.Java:910)
at Android.view.Choreographer.doCallbacks(Choreographer.Java:712)
at Android.view.Choreographer.doFrame(Choreographer.Java:646)
at Android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.Java:896)
at Android.os.Handler.handleCallback(Handler.Java:836)
at Android.os.Handler.dispatchMessage(Handler.Java:103)
at Android.os.Looper.loop(Looper.Java:203)
at Android.app.ActivityThread.main(ActivityThread.Java:6369)
at Java.lang.reflect.Method.invoke(Method.Java)
at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:1088)
at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:949)
Nous voyons ceci sur:
Versions Android: 5,6,7
Fabricants de périphériques: Lenovo, oneplus, samsung, Motorola
Et les appareils ne sont pas enracinés.
Après avoir cherché pendant un moment, je ne suis pas en mesure de trouver une cause appropriée (et une manipulation) pour cela. Je suis passé par ça question aussi mais ça n'a pas de solution.
S'il vous plaît aider.
Edit: Cela se produit pour beaucoup de nos utilisateurs, donc je ne peux pas aller dire à tout le monde de vérifier/installer webiew à partir du Play Store. Y at-il une meilleure solution pour cela?
J'ai compris un problème probable ici. Comme nous savons que Webview est une application distincte d'Android 5.0, il se peut que au moment où mon affichage est gonflé, le paquet Webview est mis à jour par l'OS webview pacakge pour ces quelques instants. Je sais que c'est un cas très limite, mais
Alors voici ce que j'ai fait (solution hacky mais empêche les plantages):
try {
// the inflating code that's causing the crash
} catch (Exception e) {
if (e.getMessage() != null && e.getMessage().contains("webview")) {
// If the system failed to inflate this view because of the WebView (which could
// be one of several types of exceptions), it likely means that the system WebView
// is either not present (unlikely) OR in the process of being updated (also unlikely).
// It's unlikely but we have been receiving a lot of crashes.
// In this case, show the user a message and finish the activity
}
}
Fondamentalement rien que gérer cette exception. Aucune science de fusée là-bas.
Veuillez vous référer à ce numéro.
Solution de contournement
try {
super.setText(spannableStringBuilder, type);
} catch (Exception e) {
// WebView is not installed in some devices by default, Linkify.MAP_ADDRESSES causes the exception
if (e.getMessage().contains("webview")){
setAutoLinkMask(Linkify.WEB_URLS | Linkify.EMAIL_ADDRESSES | Linkify.PHONE_NUMBERS);
}
super.setText(spannableStringBuilder, type);
}