ClassNotFoundException的一个ContentProvider的 [英] ClassNotFoundException for a ContentProvider

查看:419
本文介绍了ClassNotFoundException的一个ContentProvider的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ContentProvider类和AndroidMenifest.xml声明是这样的:

I have a ContentProvider class and is declared in AndroidMenifest.xml like this:

<provider android:name=".MediaSearchProvider"
    android:authorities="org.iii.romulus.meridian.mediasearch">
    <path-permission android:path="/search_suggest_query"
        android:readPermission="android.permission.GLOBAL_SEARCH" />
</provider>

它运作良好,对大多数设备,但市场告诉我,有些用户正在遭受错误吧。堆栈跟踪是:

It works well on most devices, but the Market tells me some users are suffering error with it. The stack trace is:

java.lang.RuntimeException: Unable to get provider org.iii.romulus.meridian.MediaSearchProvider: java.lang.ClassNotFoundException: org.iii.romulus.meridian.MediaSearchProvider in loader dalvik.system.PathClassLoader[/mnt/asec/org.iii.romulus.meridian-1/pkg.apk]
at android.app.ActivityThread.installProvider(ActivityThread.java:4509)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4281)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4237)
at android.app.ActivityThread.access$3000(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
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:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: org.iii.romulus.meridian.MediaSearchProvider in loader dalvik.system.PathClassLoader[/mnt/asec/org.iii.romulus.meridian-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.ActivityThread.installProvider(ActivityThread.java:4494)
... 12 more

我完全不知道是什么回事,我不能复制我的任何电话。我也试过干净而建,但报告还是来了。 任何人都可以帮忙吗?谢谢!

I have totally no idea about what's up and I can't reproduce it on any of my phones. I also tried clean and build, but the report still comes up. Anyone can help? Thanks!

推荐答案

是关于ProGuard的答案不正确。这将导致每一个电话,每一次上容易复制错误,因为ContentProvider类是完全缺失。开发人员明确指出,他们无法重现的错误,这意味着ContentProvider类是present但由于某种原因没有被发现在其用户的手机之一。

The answers regarding proguard are incorrect. This would cause an easily reproducible error on every phone, every time, because the ContentProvider class would be completely missing. The developer clearly states that they cannot reproduce the error, meaning that the ContentProvider class is present but for some reason is not being found on one of their user's phones.

我报在市场上我的应用程序死机一样。该堆栈跟踪看起来相同,并且该错误发生在installProvider。我在我的办公室约15个测试手机,没有人可以重现此问题。任何其他的想法是AP preciated。

I have the same crash reported in the market for my app. The stack traces look identical, and the error is occurring at installProvider. I have about 15 test phones in my office and none of them can reproduce this problem. Any other ideas would be appreciated.

完全限定名只有必要的,如果你的java包名不一样的你的android包名。如果没有指定一个完全合格的名称,操作系统会自动prePEND Android包名称在清单中指定的类名。

Fully qualified names in the manifest are only necessary if your java package names are not the same as your android package name. If a fully qualified name is not specified, the OS will automatically prepend the android package name to the class name specified in the manifest.

这篇关于ClassNotFoundException的一个ContentProvider的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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