3

我的报告向我提供了这个错误,但我不明白这怎么可能?

   java.lang.RuntimeException: Unable to start activity ComponentInfo{net.aviascanner.aviascanner/net.aviascanner.aviascanner.ui.activities.GetCitiesActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
            at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
            at android.app.ActivityThread.access$2600(ActivityThread.java:129)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:143)
            at android.app.ActivityThread.main(ActivityThread.java:4717)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)
    Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
            at android.view.LayoutInflater.createView(LayoutInflater.java:513)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
            at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
            at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
            ... 12 more
    Caused by: java.lang.reflect.InvocationTargetException
            at android.widget.EditText.<init>(EditText.java:51)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
            at android.view.LayoutInflater.createView(LayoutInflater.java:500)
            ... 25 more
    Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
            at android.content.res.Resources.loadDrawable(Resources.java:1725)
            at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
            at android.view.View.<init>(View.java:1901)
            at android.widget.TextView.<init>(TextView.java:440)
            at android.widget.EditText.<init>(EditText.java:55)
            ... 29 more
    Caused by: java.lang.NullPointerException
            at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
            at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
            at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
            at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
            at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
            at android.content.res.Resources.loadDrawable(Resources.java:1722)
            ... 33 more
    android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
            at android.view.LayoutInflater.createView(LayoutInflater.java:513)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
            at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
            at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
            at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
            at android.app.ActivityThread.access$2600(ActivityThread.java:129)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:143)
            at android.app.ActivityThread.main(ActivityThread.java:4717)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.reflect.InvocationTargetException
            at android.widget.EditText.<init>(EditText.java:51)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
            at android.view.LayoutInflater.createView(LayoutInflater.java:500)
            ... 25 more
    Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
            at android.content.res.Resources.loadDrawable(Resources.java:1725)
            at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
            at android.view.View.<init>(View.java:1901)
            at android.widget.TextView.<init>(TextView.java:440)
            at android.widget.EditText.<init>(EditText.java:55)
            ... 29 more
    Caused by: java.lang.NullPointerException
            at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
            at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
            at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
            at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
            at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
            at android.content.res.Resources.loadDrawable(Resources.java:1722)
            ... 33 more
    java.lang.reflect.InvocationTargetException
            at android.widget.EditText.<init>(EditText.java:51)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
            at android.view.LayoutInflater.createView(LayoutInflater.java:500)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
            at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
            at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
            at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
            at android.app.ActivityThread.access$2600(ActivityThread.java:129)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:143)
            at android.app.ActivityThread.main(ActivityThread.java:4717)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)
    Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
            at android.content.res.Resources.loadDrawable(Resources.java:1725)
            at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
            at android.view.View.<init>(View.java:1901)
            at android.widget.TextView.<init>(TextView.java:440)
            at android.widget.EditText.<init>(EditText.java:55)
            ... 29 more
    Caused by: java.lang.NullPointerException
            at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
            at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
            at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
            at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
            at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
            at android.content.res.Resources.loadDrawable(Resources.java:1722)
            ... 33 more
    android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
            at android.content.res.Resources.loadDrawable(Resources.java:1725)
            at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
            at android.view.View.<init>(View.java:1901)
            at android.widget.TextView.<init>(TextView.java:440)
            at android.widget.EditText.<init>(EditText.java:55)
            at android.widget.EditText.<init>(EditText.java:51)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
            at android.view.LayoutInflater.createView(LayoutInflater.java:500)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
            at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
            at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
            at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
            at android.app.ActivityThread.access$2600(ActivityThread.java:129)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:143)
            at android.app.ActivityThread.main(ActivityThread.java:4717)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.NullPointerException
            at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
            at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
            at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
            at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
            at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
            at android.content.res.Resources.loadDrawable(Resources.java:1722)
            ... 33 more
    java.lang.NullPointerException
            at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
            at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
            at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
            at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
            at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
            at android.content.res.Resources.loadDrawable(Resources.java:1722)
            at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
            at android.view.View.<init>(View.java:1901)
            at android.widget.TextView.<init>(TextView.java:440)
            at android.widget.EditText.<init>(EditText.java:55)
            at android.widget.EditText.<init>(EditText.java:51)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
            at android.view.LayoutInflater.createView(LayoutInflater.java:500)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
            at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
            at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
            at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
            at android.app.ActivityThread.access$2600(ActivityThread.java:129)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:143)
            at android.app.ActivityThread.main(ActivityThread.java:4717)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

2

我也在我的应用程序中发现了这个错误。在我的应用程序中,我通过在可绘制对象的所有文件夹中制作可绘制对象的副本来解决我的问题,即drawable-ldpi、drawable-mdpi、drawable-hdpi、drawable-xhdpi。这在我的应用程序中正常工作。如果您没有将可绘制对象保存到所有提供的可绘制文件夹中,希望这将解决您的问题。

于 2013-03-13T19:31:51.610 回答