我正在学习如何构建Android应用程序,这是我在进行开发人员培训时正在开发的应用程序。该应用程序在我的机器人上运行正常,直到我尝试添加操作栏。现在应用程序每次尝试启动时都会崩溃。我的java源文件似乎没有错误。
Log Cat给了我这些错误:
04-30 18:17:28.268: E/Trace(19822): error opening trace file: No such file or directory (2)
04-30 18:17:29.565: D/libEGL(19822): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
04-30 18:17:29.917: D/libEGL(19822): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
04-30 18:17:29.925: D/libEGL(19822): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
04-30 18:17:30.253: D/OpenGLRenderer(19822): Enabling debug mode 0
04-30 18:17:30.378: W/Resources(19822): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050007}
04-30 18:17:30.659: D/AndroidRuntime(19822): Shutting down VM
04-30 18:17:30.659: W/dalvikvm(19822): threadid=1: thread exiting with uncaught exception (group=0x41d0f2a0)
04-30 18:17:31.393: E/AndroidRuntime(19822): FATAL EXCEPTION: main
04-30 18:17:31.393: E/AndroidRuntime(19822): android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x12/d=0x0 a=2 r=0x7f020001}
.....
我已将应用程序卸载并重新安装到手机上,没有任何区别。我的所有可绘制文件都在res /目录中。
以下是操作栏的源代码:
/* this method is the onCreate for the action buttons in the actionbar */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// this MenuInflater object inflates menu items for use in action bar
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_activity_actions, menu);
return super.onCreateOptionsMenu(menu);
}
答案 0 :(得分:1)
我想出了这个问题,我试图访问一个不存在的.png或者我不小心删除了.png。