如何解决ActivityThread.performLaunchActivity中的java.lang.ClassNotFoundException? [英] How to resolve java.lang.ClassNotFoundException in ActivityThread.performLaunchActivity?

查看:937
本文介绍了如何解决ActivityThread.performLaunchActivity中的java.lang.ClassNotFoundException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的Android应用程序,我在Google Play的开发者控制台中收到以下错误:

For my Android application, I get the following error in Google Play's developer console:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{PACKAGE_NAME/PACKAGE_NAME.MainActivity}: java.lang.ClassNotFoundException: PACKAGE_NAME.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/PACKAGE_NAME-1/pkg.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3693)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: PACKAGE_NAME.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/PACKAGE_NAME-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)

虽然这个错误很少出现(可能会被忽略),但我发现这个更简单的是有一个无错误的开发者控制台:)而且,我只会喜欢知道这个错误的原因。

Although this error appears extremely rarely (and can probably be neglected), I find it cleaner to have a error-free developer console :) And furthermore, I would just like to know the causes for this error.

是的,好像有一个类c没有找到。但为什么?如何防止这种情况?

推荐答案

更新(4/26/15):



经过进一步的研究,我相信你是正确的事实,它绝对是一个用户错误。 [/ mnt / asec / PACKAGE_NAME-1 / pkg.apk] 很可能意味着他们正在尝试将您的应用移动到SD卡。请阅读这里:

Update(4/26/15):

After further research I believe you are right in the fact that its definitely a user error. The [/mnt/asec/PACKAGE_NAME-1/pkg.apk] most likely means they are trying to move your app to the SD card. Please read here:

Android间歇性类未找到运行时异常

无法实例化活动错误

Android:无法实例化活动/ ClassNotFoundException

这是一个Java RuntimeException as被Logcat看到。我没有看到这个事情发生在许多次之前,当我还没有添加活动清单正确。

This is a Java RuntimeException as seen by Logcat. I've seen this happen many times before when I have not added the Activity to manifest correctly.

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{PACKAGE_NAME/PACKAGE_NAME.MainActivity}: java.lang.ClassNotFoundException: PACKAGE_NAME.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/PACKAGE_NAME-1/pkg.apk]

这篇关于如何解决ActivityThread.performLaunchActivity中的java.lang.ClassNotFoundException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆