我做了本教程的第一部分......
http://developer.android.com/training/search/setup.html
我创建了options_menu.xml并将代码添加到onCreateOptionsMenu()方法中。在我的设备上运行我的应用程序后,它会打开并自动崩溃。抱歉,我不知道我是否正确格式化了下面的LogCat消息,但我将其复制/粘贴到此处,这样可以帮助确定问题所在,我不确定如何阅读或解决问题。如果我可以更正确地格式化它,或者如果需要可能导出其他错误消息,请告诉我。在“问题”下我有两个......
不确定那是否重要...谢谢!
03-30 19:13:06.266: W/ApplicationPackageManager(17378): getCSCPackageItemText()
03-30 19:13:06.326: E/MoreInfoHPW_ViewGroup(17378): Parent view is not a TextView
03-30 19:13:06.436: I/Adreno-EGL(17378): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
03-30 19:13:06.436: I/Adreno-EGL(17378): OpenGL ES Shader Compiler Version: E031.24.00.07
03-30 19:13:06.436: I/Adreno-EGL(17378): Build Date: 01/22/14 Wed
03-30 19:13:06.436: I/Adreno-EGL(17378): Local Branch: base_au149_adreno_au169_patches
03-30 19:13:06.436: I/Adreno-EGL(17378): Remote Branch:
03-30 19:13:06.436: I/Adreno-EGL(17378): Local Patches:
03-30 19:13:06.436: I/Adreno-EGL(17378): Reconstruct Branch:
03-30 19:13:06.466: D/OpenGLRenderer(17378): Enabling debug mode 0
03-30 19:13:06.496: W/ResourceType(17378): getEntry failing because entryIndex 1 is beyond type entryCount 1
03-30 19:13:06.496: W/ResourceType(17378): Failure getting entry for 0x7f0c0001 (t=11 e=1) in package 0 (error -2147483647)
03-30 19:13:06.496: D/AndroidRuntime(17378): Shutting down VM
03-30 19:13:06.496: W/dalvikvm(17378): threadid=1: thread exiting with uncaught exception (group=0x417adda0)
03-30 19:13:06.506: E/AndroidRuntime(17378): FATAL EXCEPTION: main
03-30 19:13:06.506: E/AndroidRuntime(17378): Process: com.example.csbizsearch, PID: 17378
03-30 19:13:06.506: E/AndroidRuntime(17378): android.content.res.Resources$NotFoundException: Resource ID #0x7f0c0001
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.content.res.Resources.getValue(Resources.java:2009)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.content.res.Resources.loadXmlResourceParser(Resources.java:3224)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.content.res.Resources.getLayout(Resources.java:1825)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.support.v7.internal.view.SupportMenuInflater.inflate(SupportMenuInflater.java:115)
03-30 19:13:06.506: E/AndroidRuntime(17378): at com.example.csbizsearch.MainActivity.onCreateOptionsMenu(MainActivity.java:30)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.app.Activity.onCreatePanelMenu(Activity.java:2588)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:224)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:232)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:199)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293)
03-30 19:13:06.506: E/AndroidRuntime(17378): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:486)
03-30 19:13:06.506: E/AndroidRuntime(17378): at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:855)
03-30 19:13:06.506: E/AndroidRuntime(17378): at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:271)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.view.Choreographer.doCallbacks(Choreographer.java:603)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.view.Choreographer.doFrame(Choreographer.java:572)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.os.Handler.handleCallback(Handler.java:733)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.os.Handler.dispatchMessage(Handler.java:95)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.os.Looper.loop(Looper.java:157)
03-30 19:13:06.506: E/AndroidRuntime(17378): at android.app.ActivityThread.main(ActivityThread.java:5293)
03-30 19:13:06.506: E/AndroidRuntime(17378): at java.lang.reflect.Method.invokeNative(Native Method)
03-30 19:13:06.506: E/AndroidRuntime(17378): at java.lang.reflect.Method.invoke(Method.java:515)
03-30 19:13:06.506: E/AndroidRuntime(17378): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
03-30 19:13:06.506: E/AndroidRuntime(17378): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
03-30 19:13:06.506: E/AndroidRuntime(17378): at dalvik.system.NativeStart.main(Native Method)
03-30 19:13:09.836: I/Process(17378): Sending signal. PID: 17378 SIG: 9
答案 0 :(得分:0)
&#39; ave在Android Studio中没有出现此错误,因此我将继续使用此而不是eclipse ...如果有人找到了解决方案,那将会很棒!!