本文介绍了获取更新ADT的16至17 ADT后ClassNotFound的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序工作正常。但只要我更新ADT的16至17 ADT然后我收到此错误

My Application was working fine. But as soon as i updated from ADT 16 to ADT 17 then i am getting this error

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

如何解决?

推荐答案

出现此问题的原因是lib目录文件夹重命名为库现在Android的人。而只要我们把我们的外部罐这个库文件夹,然后它会自动被添加到应用程序的构建路径。

This issue occurs because the "lib" folder is renamed to "libs" now by Android People.And as soon as we place our external jars to this "libs" folder then it will automatically be added to the build path of the application.

这篇关于获取更新ADT的16至17 ADT后ClassNotFound的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 22:16