我在 Eclipse Indigo 中有一个带有 ADT 版本 15 的 Android 应用程序。将 ADT 升级到版本 21 程序崩溃并且无法在模拟器和移动设备上执行。
LogCat 显示此错误消息:
12-05 10:07:35.960: E/AndroidRuntime(31462): FATAL EXCEPTION: main
12-05 10:07:35.960: E/AndroidRuntime(31462): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{test.hello/test.StartActivityZZ}: java.lang.ClassNotFoundException: test.start.StartActivityZZ
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2024)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.access$600(ActivityThread.java:140)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.os.Looper.loop(Looper.java:137)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.main(ActivityThread.java:4898)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.reflect.Method.invoke(Method.java:511)
12-05 10:07:35.960: E/AndroidRuntime(31462): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
12-05 10:07:35.960: E/AndroidRuntime(31462): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
12-05 10:07:35.960: E/AndroidRuntime(31462): at dalvik.system.NativeStart.main(Native Method)
12-05 10:07:35.960: E/AndroidRuntime(31462): Caused by: java.lang.ClassNotFoundException: test.start.StartActivityZZ
12-05 10:07:35.960: E/AndroidRuntime(31462): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.Instrumentation.newActivity(Instrumentation.java:1057)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
12-05 10:07:35.960: E/AndroidRuntime(31462): ... 11 more
Android 项目使用 maven,但在没有 maven 的情况下创建一个新项目,问题仍然存在并显示相同的消息。
有什么建议可以解决这个问题吗?谢谢