IGE Android 6.0中的Android XmlPullParserException

时间:2019-06-05 10:35:33

标签: android

<drawable/>无法在LGE上解析。个人猜测是系统已经升级了Version,但是Drawable中的解析代码没有同步更新。但是该如何解决?

app/src/main/res/drawable-v24/splash.xml

<?xml version="1.0" encoding="utf-8"?>
<drawable  xmlns:android="http://schemas.android.com/apk/res/android"
  class="com.SplashDrawable" >

</drawable>

app/src/main/res/drawable/splash.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  <item>
    <bitmap android:src="@drawable/loading"/>
  </item>
</layer-list>
Caused by android.content.res.Resources$NotFoundException: File res/drawable-v24/splash.xml from drawable resource ID #0x7f08038d
       at android.content.res.Resources.loadDrawableForCookie(Resources.java:2748)
       at android.content.res.Resources.loadDrawable(Resources.java:2643)
       at android.content.res.Resources.getDrawable(Resources.java:833)
       at android.content.Context.getDrawable(Context.java:458)
       at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:358)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)
       at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:85)
       at android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:128)
       at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:149)
       at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:56)
       at android.support.v7.app.AppCompatDelegateImplV23.(AppCompatDelegateImplV23.java:31)
       at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:200)
       at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:183)
       at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519)
       at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:70)
       at com.play.taptap.ui.SplashAct.onCreate(SplashAct.java:22)
       at android.app.Activity.performCreate(Activity.java:6272)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
       at android.app.ActivityThread.access$900(ActivityThread.java:157)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5525)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag drawable
       at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1211)
       at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1124)
       at android.content.res.Resources.loadDrawableForCookie(Resources.java:2733)
       at android.content.res.Resources.loadDrawable(Resources.java:2643)
       at android.content.res.Resources.getDrawable(Resources.java:833)
       at android.content.Context.getDrawable(Context.java:458)
       at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:358)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)
       at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:85)
       at android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:128)
       at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:149)
       at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:56)
       at android.support.v7.app.AppCompatDelegateImplV23.(AppCompatDelegateImplV23.java:31)
       at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:200)
       at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:183)
       at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519)
       at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:70)
       at com.play.taptap.ui.SplashAct.onCreate(SplashAct.java:22)
       at android.app.Activity.performCreate(Activity.java:6272)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
       at android.app.ActivityThread.access$900(ActivityThread.java:157)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5525)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

0 个答案:

没有答案