1

当我尝试启动我的应用程序时,出现以下错误:

05-21 16:51:58.081: E/AndroidRuntime(8873): FATAL EXCEPTION: main
05-21 16:51:58.081: E/AndroidRuntime(8873): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.foodev.myApp/de.foodev.myApp.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "de.foodev.myApp.MainActivity" on path: /data/app/de.foodev.myApp-2.apk
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.os.Looper.loop(Looper.java:137)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.ActivityThread.main(ActivityThread.java:5041)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at java.lang.reflect.Method.invokeNative(Native Method)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at java.lang.reflect.Method.invoke(Method.java:511)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at dalvik.system.NativeStart.main(Native Method)
05-21 16:51:58.081: E/AndroidRuntime(8873): Caused by: java.lang.ClassNotFoundException: Didn't find class "de.foodev.myApp.MainActivity" on path: /data/app/de.foodev.myApp-2.apk
05-21 16:51:58.081: E/AndroidRuntime(8873):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
05-21 16:51:58.081: E/AndroidRuntime(8873):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
05-21 16:51:58.081: E/AndroidRuntime(8873):     ... 11 more

这是应用程序的开头:

public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
                ...

任何提示错误可能是什么?

4

1 回答 1

1

正如 Krauxe 所写,由于 ADT 22 的更新,这是一个错误。

我用这个解决方案解决了这个问题:Project -> Properties -> Java Build Path -> Order & Export并确保为您的项目和您正在使用的所有其他库项目检查Android Private Libraries 。在这里发布

于 2013-05-21T17:00:24.113 回答