我有一个包含多项活动的应用程序。
他们中的一对只是一个简单的菜单。
只是线性布局。几个按钮
我在移动设备的开发和调试过程中从未见过以下错误。
但是,用户的崩溃报告和投诉表明,有时候应用程序只会关闭并且会让人感到愤怒。
错误示例如下。
任何想法在哪里挖掘?
抱歉,我现在无法显示来源。我会在几个小时内添加它们。
布局是在Ecliple android插件中创建的。没有额外的东西。
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.reality.weapons.ak47/com.reality.weapons.ak47.MultiMenu}: android.view.InflateException: Binary XML file line #2: Error inflating class java.lang.reflect.Constructor
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2297)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3307)
at android.app.ActivityThread.access$2100(ActivityThread.java:115)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1725)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3977)
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:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class java.lang.reflect.Constructor
at android.view.LayoutInflater.createView(LayoutInflater.java:512)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:313)
at android.app.Activity.setContentView(Activity.java:1683)
at com.reality.weapons.ak47.MultiMenu.onCreate(MultiMenu.java:75)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2260)
============================
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.reality.weapons.ak47/com.reality.weapons.ak47.MultiMenu}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030005
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.content.res.Resources$NotFoundException: Resource ID #0x7f030005
at android.content.res.Resources.getValue(Resources.java:901)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:1897)
at android.content.res.Resources.getLayout(Resources.java:740)
at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:226)
at android.app.Activity.setContentView(Activity.java:1677)
at com.reality.weapons.ak47.MultiMenu.onCreate(MultiMenu.java:75)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
============================
答案 0 :(得分:0)
你能检查一下布局吗?不知道在哪里没有查看布局XML文件,但看起来创建布局时出现问题,即找不到资源。 Resources$NotFoundException: Resource ID #0x7f030005
如果您可以发布超过堆栈跟踪的信息,则可以更轻松地查看其中的内容。
答案 1 :(得分:0)
似乎是版本问题。您在哪个Android版本中收到此错误?你的程序有图形资源吗?
Android 1.5不支持drawable-Xdpi文件夹,因此您必须创建一个可绘制文件夹,并将所有内容放在那里。
你可以看看这里... http://stackoverflow.com/questions/2923823/android-2-2-sdk-breaks-compatibility-with-older-phones