android app项目错误

时间:2013-05-21 01:02:36

标签: android eclipse

由于某些原因,我一直无法在我的eclipse android项目中打开跟踪错误。一切都是语法错误。

这是我的日志文本。

05-20 19:57:02.330: D/AndroidRuntime(30377): Shutting down VM
05-20 19:57:02.330: W/dalvikvm(30377): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
05-20 19:57:02.340: E/AndroidRuntime(30377): FATAL EXCEPTION: main
05-20 19:57:02.340: E/AndroidRuntime(30377): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.sudoku/com.example.sudoku.Sudoku}: java.lang.ClassNotFoundException: com.example.sudoku.Sudoku in loader dalvik.system.PathClassLoader[/data/app/com.example.sudoku-2.apk]
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.os.Looper.loop(Looper.java:130)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.ActivityThread.main(ActivityThread.java:3691)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at java.lang.reflect.Method.invokeNative(Native Method)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at java.lang.reflect.Method.invoke(Method.java:507)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at dalvik.system.NativeStart.main(Native Method)
05-20 19:57:02.340: E/AndroidRuntime(30377): Caused by: java.lang.ClassNotFoundException: com.example.sudoku.Sudoku in loader dalvik.system.PathClassLoader[/data/app/com.example.sudoku-2.apk]
05-20 19:57:02.340: E/AndroidRuntime(30377):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-20 19:57:02.340: E/AndroidRuntime(30377):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
05-20 19:57:02.340: E/AndroidRuntime(30377):    ... 11 more
05-20 19:57:04.352: I/dalvikvm(30377): threadid=4: reacting to signal 3
05-20 19:57:04.352: E/dalvikvm(30377): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
05-20 19:57:12.039: I/Process(30377): Sending signal. PID: 30377 SIG: 9

2 个答案:

答案 0 :(得分:1)

你有:

Caused by: java.lang.ClassNotFoundException: com.example.sudoku.Sudoku in loader dalvik.system.PathClassLoader[/data/app/com.example.sudoku-2.apk]

a ClassNotFoundException,也许您在清单文件中错误地定义了它。 正如您所说,您有两个类About.javaMainActivity.java,这意味着您尝试在清单中定义一个Sudoku类,但尚未将其创建为java文件。

答案 1 :(得分:1)

“我的java类是:About.java MainActivity.java我的布局是:about.xml activity_main.xml” 那你的Sudoku.java类在哪里?也许你不小心删了它或者更改了它的名字?