1

我的应用程序在使用此日志启动时崩溃:

09-25 07:12:27.721: W/ResourceType(361): Failure getting entry for 0x7f030016 (t=2 e=22) in package 0: 0xffffffb5
09-25 07:12:27.721: D/AndroidRuntime(361): Shutting down VM
09-25 07:12:27.721: W/dalvikvm(361): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
09-25 07:12:27.741: E/AndroidRuntime(361): FATAL EXCEPTION: main
09-25 07:12:27.741: E/AndroidRuntime(361): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.villaparvaneh/com.villaparvaneh.VillaListActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030016
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.os.Looper.loop(Looper.java:123)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.ActivityThread.main(ActivityThread.java:4627)
09-25 07:12:27.741: E/AndroidRuntime(361):  at java.lang.reflect.Method.invokeNative(Native Method)
09-25 07:12:27.741: E/AndroidRuntime(361):  at java.lang.reflect.Method.invoke(Method.java:521)
09-25 07:12:27.741: E/AndroidRuntime(361):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-25 07:12:27.741: E/AndroidRuntime(361):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-25 07:12:27.741: E/AndroidRuntime(361):  at dalvik.system.NativeStart.main(Native Method)
09-25 07:12:27.741: E/AndroidRuntime(361): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030016
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.content.res.Resources.getValue(Resources.java:892)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.content.res.Resources.getLayout(Resources.java:731)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-25 07:12:27.741: E/AndroidRuntime(361):  at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:840)
09-25 07:12:27.741: E/AndroidRuntime(361):  at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:261)
09-25 07:12:27.741: E/AndroidRuntime(361):  at com.villaparvaneh.VillaListActivity.onCreate(VillaListActivity.java:47)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-25 07:12:27.741: E/AndroidRuntime(361):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-25 07:12:27.741: E/AndroidRuntime(361):  ... 11 more

起初我使用 eclipse 向导创建一个主/详细活动,我minsdk的设置为 11。但后来我使用ActionBarSherlock并更改了我的活动代码,仅此而已!第一次午餐时,没有将主题设置为Theme.Sherlock.Light. 更改样式文件后,出现上述错误!我用谷歌搜索了一天并阅读了一些类似的问题thisthis,但似乎我的问题与它们无关。0x7f030016我在文件中搜索资源R.java并发现它是并且在以下行中或在以下行R.attr.actionModeCloseDrawable中引发了异常:setContentView(int layoutResId)ActionBarSherlockCompat.javaActionBarSherlockNative.java

mActivity.getLayoutInflater().inflate(layoutResId, mContentParent);

其中layoutResIdisR.attr.actionModeCloseDrawablemContentParent是 的一个实例com.actionbarsherlock.internal.nineoldandroids.widget.NineFrameLayout。我花了一整天的时间检查谷歌上的每个相关链接,但我无法弄清楚发生了什么。我使用 Android 4.3 构建应用程序并支持库修订版 18。我认为我的代码在这里没有用,因为我的代码中没有发生错误。可能需要文件夹中的一些 xml 文件res,只需告诉添加哪个文件即可。任何想法?谢谢

4

0 回答 0