0

由于某种原因,我一直在我的 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
4

2 回答 2

1

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

于 2013-05-21T01:47:09.670 回答
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这意味着您正在尝试在清单中定义一个数独类,但尚未将其创建为 java 文件。

于 2013-05-21T01:07:22.910 回答