gpt4 book ai didi

android - 从 Google Play 下载时出现 ClassNotFoundException

转载 作者:行者123 更新时间:2023-11-29 15:22:14 25 4
gpt4 key购买 nike

我遇到了一个涉及 ClassNotFoundException 的问题。当我从 Eclipse 中“作为 Android 应用程序运行”时它工作正常,但是当我从 Google Play 下载它时(相同的源代码但“导出为已签名的应用程序”)它崩溃并出现以下堆栈跟踪:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.larphoid.aeboing/com.larphoid.aeboing.BoingBoing}: java.lang.ClassNotFoundException: com.larphoid.aeboing.BoingBoing in loader dalvik.system.PathClassLoader[/data/app/com.larphoid.aeboing-1.apk]     
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2703)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2797)
at android.app.ActivityThread.access$2300(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2132)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4914)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.larphoid.aeboing.BoingBoing in loader dalvik.system.PathClassLoader[/data/app/com.larphoid.aeboing-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newActivity(Instrumentation.java:1033)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695)
... 11 more

我以前从未遇到过这个问题,而且我还没有“阅读”Stacktraces 的经验,所以我对此感到非常困惑。如果有人有一些指示或解决方案,我将不胜感激。

谢谢。

最佳答案

从另一个问题中复制这个,因为我之前遇到过完全相同的问题,这就是我修复它的方法:

If you're running adt rev 22, you might not be exporting your libraries. I don't know why Google did this exactly, but in the newest revolution you have to check to make sure you're exporting your libraries yourself.

Right click your project, click Properties, and check Order & Export under Java Build Path. It should look like this if you want to export everything:

enter image description here Afterwards, rebuild the application and export it again. It should be working now. To test, simply install the .apk to your phone manually before putting it on the store to make sure it works.

关于android - 从 Google Play 下载时出现 ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17299309/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com