我想知道如果任何人能幫助我,我正在寫一個機器人程序,每當我運行模擬器,這些錯誤顯示:Android的運行時錯誤
03-24 15:06:17.464: E/AndroidRuntime(792): FATAL EXCEPTION: main
03-24 15:06:17.464: E/AndroidRuntime(792): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.gridviewexample/com.example.gridviewexample.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.gridviewexample.MainActivity" on path: /data/app/com.example.gridviewexample-2.apk
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.os.Handler.dispatchMessage(Handler.java:99)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.os.Looper.loop(Looper.java:137)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-24 15:06:17.464: E/AndroidRuntime(792): at java.lang.reflect.Method.invokeNative(Native Method)
03-24 15:06:17.464: E/AndroidRuntime(792): at java.lang.reflect.Method.invoke(Method.java:511)
03-24 15:06:17.464: E/AndroidRuntime(792): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-24 15:06:17.464: E/AndroidRuntime(792): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-24 15:06:17.464: E/AndroidRuntime(792): at dalvik.system.NativeStart.main(Native Method)
03-24 15:06:17.464: E/AndroidRuntime(792): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.gridviewexample.MainActivity" on path: /data/app/com.example.gridviewexample-2.apk
03-24 15:06:17.464: E/AndroidRuntime(792): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
03-24 15:06:17.464: E/AndroidRuntime(792): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-24 15:06:17.464: E/AndroidRuntime(792): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
03-24 15:06:17.464: E/AndroidRuntime(792): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
03-24 15:06:17.464: E/AndroidRuntime(792): ... 11 more
我想寫一格查看代碼,我真的很感激,如果有人可以幫忙,非常感謝:)
ClassNotFoundException是有意義的部分。閱讀這些行。另外,這些不是多重錯誤。這是一個錯誤的堆棧跟蹤。 – keyser 2013-03-24 15:16:12