无法膨胀错误的可能原因是什么?

时间:2011-12-15 07:52:39

标签: android debugging inflate

我已经在模拟器和HTC欲望中测试了我的应用程序,它继续运行正常,但是当我转向使用CyanogenMod的三星S2时,应用程序崩溃并在下方进行logcat打印:

12-15 15:48:18.839: ERROR/ActivityThread(13804): Failed to inflate
12-15 15:48:18.839: ERROR/ActivityThread(13804): android.view.InflateException: Binary XML file line #35: Error inflating class android.widget.Button
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:212)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.Activity.setContentView(Activity.java:1657)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at com.appkon.hdtvs.HDtvs.onCreate(HDtvs.java:37)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.ActivityThread.access$1500(ActivityThread.java:123)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.os.Looper.loop(Looper.java:130)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.app.ActivityThread.main(ActivityThread.java:3835)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at java.lang.reflect.Method.invokeNative(Native Method)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at java.lang.reflect.Method.invoke(Method.java:507)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at dalvik.system.NativeStart.main(Native Method)
12-15 15:48:18.839: ERROR/ActivityThread(13804): Caused by: java.lang.reflect.InvocationTargetException
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at java.lang.reflect.Constructor.constructNative(Native Method)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     ... 23 more
12-15 15:48:18.839: ERROR/ActivityThread(13804): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/share.xml from drawable resource ID #0x7f020042
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.content.res.Resources.loadDrawable(Resources.java:1773)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.view.View.<init>(View.java:1967)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.widget.TextView.<init>(TextView.java:350)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.widget.Button.<init>(Button.java:108)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.widget.Button.<init>(Button.java:104)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     ... 26 more
12-15 15:48:18.839: ERROR/ActivityThread(13804): Caused by: java.lang.NullPointerException
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.graphics.drawable.AnimatedRotateDrawable.inflate(AnimatedRotateDrawable.java:222)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     at android.content.res.Resources.loadDrawable(Resources.java:1770)
12-15 15:48:18.839: ERROR/ActivityThread(13804):     ... 31 more

知道为什么会这样吗?

0 个答案:

没有答案