在Eclipse上运行模拟器我有这个错误

时间:2013-11-29 14:32:16

标签: android eclipse

当我在Eclipse上运行应用程序时向我显示此消息(程序已意外停止请稍后再试)强制停止并且我有此错误异常:

11-29 17:22:18.893: D/AndroidRuntime(275): Shutting down VM
11-29 17:22:18.893: W/dalvikvm(275): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-29 17:22:18.923: E/AndroidRuntime(275): FATAL EXCEPTION: main
11-29 17:22:18.923: E/AndroidRuntime(275): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.progress_bar/com.example.progress_bar.MainActivity}: java.lang.ClassNotFoundException: com.example.progress_bar.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.progress_bar-1.apk]
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.os.Looper.loop(Looper.java:123)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.ActivityThread.main(ActivityThread.java:4627)
11-29 17:22:18.923: E/AndroidRuntime(275):  at java.lang.reflect.Method.invokeNative(Native Method)
11-29 17:22:18.923: E/AndroidRuntime(275):  at java.lang.reflect.Method.invoke(Method.java:521)
11-29 17:22:18.923: E/AndroidRuntime(275):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-29 17:22:18.923: E/AndroidRuntime(275):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-29 17:22:18.923: E/AndroidRuntime(275):  at dalvik.system.NativeStart.main(Native Method)
11-29 17:22:18.923: E/AndroidRuntime(275): Caused by: java.lang.ClassNotFoundException: com.example.progress_bar.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.progress_bar-1.apk]
11-29 17:22:18.923: E/AndroidRuntime(275):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
11-29 17:22:18.923: E/AndroidRuntime(275):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
11-29 17:22:18.923: E/AndroidRuntime(275):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-29 17:22:18.923: E/AndroidRuntime(275):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
11-29 17:22:18.923: E/AndroidRuntime(275):  ... 11 more

1 个答案:

答案 0 :(得分:-1)

您可以发布您的MainActivity.xml吗?我建议您在创建项目时将com.example。 appname 重命名为app。 appname 。 Play商店不接受com.example前缀。