"无法实例化活性QUOT;错误 [英] "Unable to instantiate activity" error

查看:121
本文介绍了"无法实例化活性QUOT;错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个Android应用程序拥有约10万用户,并每周约10倍,我得到通过谷歌的市场工具正在向我报告以下异常:

One of my Android apps has about 100,000 users and, about 10 times a week, I get the following exception being reported to me via Google's market tool:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.rebm.asp/org.rebm.asp.MainActivity}:
  java.lang.ClassNotFoundException: org.rebm.asp.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/org.rebm.asp-1/pkg.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753)
at android.app.ActivityThread.access$2500(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4701)
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:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: org.rebm.asp.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/org.rebm.asp-1/pkg.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:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2651)
... 11 more

从网上搜索,这个错误通常表示事情是错误的清单文件和所使用的包名。但是,我不能在我自己的设备或模拟器上重现此错误。我只知道通过市场工具,这个错误的。所有我可以断定的是,这是一个罕见的错误,因为我知道很多人都在用的应用程序,并没有任何的评论表明它崩溃。

From searching online, this error usually indicates something is wrong with the manifest file and the package names being used. However, I can't reproduce this error on my own devices or on the emulator. I only know of this error through the market tool. All I can conclude is that it's a rare error because I know lots of people are using the app and none of the reviews indicate it crashes.

有谁知道是什么问题,可能是或如何我可以诊断呢?

Does anyone know what the issue might be or how I can diagnose it?

推荐答案

这是你给的问题堆栈跟踪包含证明该问题是由于移动应用程序到SD卡:

The stack trace that you give in the question contains the proof that the problem is due to moving the app to the SD card:

了java.lang.RuntimeException:无法   实例活动   ComponentInfo {org.rebm.asp / org.rebm.asp.MainActivity}:   抛出java.lang.ClassNotFoundException:   org.rebm.asp.MainActivity装载机   dalvik.system.PathClassLoader [/mnt/asec/org.rebm.asp-1/pkg.apk]

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

正如你所看到的,路径,您的应用程序中包含的的/ mnt / ASEC 这是Android的安全应用程序安装点。

As you can see, the path to your application is contains /mnt/asec which is the Android secure application mount point.

为了验证是否发生此问题,由于上apps2sd,你应该检查,看看是否所有的堆栈跟踪你必须包含在的/ mnt / ASEC 目录的路径,你的应用程序。如果他们都是这样,你可以肯定,这是一个上apps2sd错误。

In order to verify if this problem happens due to Apps2SD, you should check to see if all the stack traces you have include the /mnt/asec directory in the path to your application. If they are all so, you can be sure that it is an Apps2SD error.

正如其他人所说,这类问题有时由于SD卡没有被使用时,应用程序被加载或出现损坏的 ASEC 在SD卡上的分区。

As others have said, these kinds of problems sometime arise due to the SD card not being available when the application is being loaded or from a corrupt asec partition on the SD card.

请问您的应用程序,以任何方式,其自身注册为启动时启动或者是某种形式的一个小部件,系统会尝试甚至当SD卡未安装尚未加载的?如果是这样,也许你应该关掉移动应用程序到SD卡的选项。

Does your app, in any way, register itself to launch at boot or is it some sort of a widget that the system would try to load even when the SD card has not been mounted yet? If so, maybe you should turn off the option of moving the app to the SD card.

这篇关于"无法实例化活性QUOT;错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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