迁移到最新的ADT和android sdk后,Android应用程序无法运行

时间:2012-12-05 08:29:35

标签: android android-intent adt android-maven-plugin

我在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的新项目,问题仍然存在并显示相同的消息。

有任何解决此问题的建议吗? 感谢

1 个答案:

答案 0 :(得分:0)

在某些时候(可能在第15版之后),您使用的库必须放在“libs”文件夹中。尝试在那里放置库的副本并重试