1

Android API 19 での次のクラッシュを説明する Fabric の Crashlytics から次のデータを取得しています。

これは、AVD (Nexus 4) でテストされました。

    Fatal Exception: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052
                 at android.content.res.Resources.loadDrawable(Resources.java:2101)
                 at android.content.res.Resources.getDrawable(Resources.java:700)
                 at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
                 at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
                 at android.support.design.widget.TabLayout$TabView.<init>(TabLayout.java:1362)
                 at android.support.design.widget.TabLayout.createTabView(TabLayout.java:797)
                 at android.support.design.widget.TabLayout.newTab(TabLayout.java:500)
                 at fr.ayoubdev.rnak.components.tab.TabLayoutManager.addView(TabLayoutManager.java:66)
                 at fr.ayoubdev.rnak.components.tab.TabLayoutManager.addView(TabLayoutManager.java:17)
                 at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:384)
                 at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:175)
                 at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:782)
                 at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)
                 at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:44)
                 at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:868)
                 at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
                 at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
                 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:759)
                 at android.view.Choreographer.doCallbacks(Choreographer.java:574)
                 at android.view.Choreographer.doFrame(Choreographer.java:543)
                 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
                 at android.os.Handler.handleCallback(Handler.java:733)
                 at android.os.Handler.dispatchMessage(Handler.java:95)
                 at android.os.Looper.loop(Looper.java:136)
                 at android.app.ActivityThread.main(ActivityThread.java:5017)
                 at java.lang.reflect.Method.invokeNative(Method.java)
                 at java.lang.reflect.Method.invoke(Method.java:515)
                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                 at dalvik.system.NativeStart.main(NativeStart.java)
    Caused by org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
                 at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
                 at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
                 at android.content.res.Resources.loadDrawable(Resources.java:2097)
                 at android.content.res.Resources.getDrawable(Resources.java:700)
                 at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
                 at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
                 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
                 at android.support.design.widget.TabLayout$TabView.<init>(TabLayout.java:1362)
                 at android.support.design.widget.TabLayout.createTabView(TabLayout.java:797)
                 at android.support.design.widget.TabLayout.newTab(TabLayout.java:500)
                 at fr.ayoubdev.rnak.components.tab.TabLayoutManager.addView(TabLayoutManager.java:66)
                 at fr.ayoubdev.rnak.components.tab.TabLayoutManager.addView(TabLayoutManager.java:17)
                 at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:384)
                 at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:175)
                 at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:782)
                 at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)
                 at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:44)
                 at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:868)
                 at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
                 at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
                 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:759)
                 at android.view.Choreographer.doCallbacks(Choreographer.java:574)
                 at android.view.Choreographer.doFrame(Choreographer.java:543)
                 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
                 at android.os.Handler.handleCallback(Handler.java:733)
                 at android.os.Handler.dispatchMessage(Handler.java:95)
                 at android.os.Looper.loop(Looper.java:136)
                 at android.app.ActivityThread.main(ActivityThread.java:5017)
                 at java.lang.reflect.Method.invokeNative(Method.java)
                 at java.lang.reflect.Method.invoke(Method.java:515)
                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                 at dalvik.system.NativeStart.main(NativeStart.java)

何が起こっているのか本当に理解できませんでした。誰でも助けることができますか?

どうもありがとう、ダニエル。

4

1 に答える 1

2

How to use vector drawables in Android API Lower 21? をご覧ください。

別の救済策は次のとおりです。

static
{
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
于 2016-10-29T22:10:44.637 に答える