运行导出APK时,它得到了“抛出java.lang.ClassNotFoundException”错误 [英] It got the 'java.lang.ClassNotFoundException' error when run the export apk
问题描述
我写在Eclipse中的Android应用程序,使用运行命令在我的手机上。
I write a android app in Eclipse and use run command on my cellphone.
它在我的手机上运行成功。
It's run success on my cellphone.
但是我用[Android的工具 - >导出签名的应用程序包...]导出我的应用程序
But I use [Android Tools -> Export Signed Application Package...] to export my app.
然后用[ADB安装]在我的手机和运行安装APK。
Then use [adb install] to install apk on my cellphone and run.
和我得到的错误信息:
07-22 11:20:43.537: E/AndroidRuntime(20216): Caused by: java.lang.ClassNotFoundException: com.mytest.MyActivity in loader dalvik.system.PathClassLoader[/data/app/com.mytest-1.apk]
在[Java构建路径 - >订单和出口。我被选中所有
In [Java Build Path -> Order and Export], I have been selected all.
在AndroidManifest.xml中,应用程序属性没有机器人:名称
In AndroidManifest.xml, the application attribute doesn't have android:name.
我不知道如何解决这个问题。
I don't know how to solve this problem.
我的成功使用Eclipse在我的手机,为什么运行错误,当我出口的应用程序运行?
I'm success use Eclipse run on my cellphone, why run error when I export the app?
请帮帮我,谢谢!
推荐答案
似乎有多种原因,这种情况的发生,从我所研究。你有一个lib文件夹?如果是的话把它改为库。
There seems to multiple reasons for this happening from what I have researched. Do you have a lib folder? if so change it to "libs".
你有ProGuard的启用?如果是的话,可能会引起问题。 也可以尝试取消选中机器人###和Android的相关性的构建路径,订单和出口。
Do you have proguard enabled? If so that may cause the problem. Also try unchecking the "Android #.#.#" and "Android Dependencies" in your Build Path, Order and Export.
看看这个线程里面有一大堆其他可能的解决方案,他们中的很多处理中设置合适的ActivityName清单文件中。 <一href="http://stackoverflow.com/questions/3781151/java-lang-classnotfoundexception-on-working-app">java.lang.ClassNotFoundException在工作应用
Check out this thread which has a bunch of other possible solutions, a lot of them deal with setting the proper ActivityName in the manifest file. java.lang.ClassNotFoundException on working app
如果这些解决方案仍然不能解决问题尝试这些线程。
If those solutions still don't solve the problem try these threads.
<一个href="http://stackoverflow.com/questions/4820554/android-unable-to-instantiate-activity-classnotfoundexception">Android:无法实例活动/ ClassNotFoundException的
<一个href="http://stackoverflow.com/questions/3090009/classnotfoundexception-android">ClassNotFoundException安卓
这篇关于运行导出APK时,它得到了“抛出java.lang.ClassNotFoundException”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!