我有超過100.000個用戶的應用程序。但在某些設備上(〜50),我收到了一個奇怪的例外。堆棧跟蹤說,有一個drawable沒有找到。
這裏是堆棧跟蹤:
java.lang.RuntimeException: Unable to start activity ComponentInfo{mindmApp.the.big.bang.theory.quiz/mindmApp.the.big.bang.theory.quiz.GameNormalActivity}: android.view.InflateException: Binary XML file line #237: Error inflating class
...
Caused by: android.view.InflateException: Binary XML file line #237: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
...
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:586)
... 28 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/textviewxml_joker.xml from drawable resource ID #0x7f02003d
at android.content.res.Resources.loadDrawable(Resources.java:1956)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.(View.java:2841)
at android.widget.TextView.(TextView.java:580)
at android.widget.TextView.(TextView.java:573)
我不知道爲什麼這繪製(這是一個XML文件)未找到。
二進制XML文件線#237:
<TextView
android:id="@+id/textViewSkip"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="@drawable/textviewxml_joker"
android:gravity="center"
android:text="@string/tvSkip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/color_textview"
android:textSize="22sp" />
這裏是textviewxml_joker.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/textview_joker_pressed"
android:state_pressed="true"/>
<item android:drawable="@drawable/textview_joker"/>
</selector>
有任何人的想法牛逼osolve這個問題?
最好的問候!
這個'textviewxml_joker.xml'文件存在於'drawable'文件夾中嗎? – user370305
是的,textviewxml_joker.xml文件是可繪製的文件夾。 – Namenlos
嗨@Namenlos,我面臨着類似的問題..任何運氣與此?請分享。 –