ClassNotFoundException:在路径:DexPathList上找不到类 [英] ClassNotFoundException: Didn't find class on path: DexPathList

查看:565
本文介绍了ClassNotFoundException:在路径:DexPathList上找不到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从在Playstore更新我的应用程序以来,我遇到了问题。自从此更新以来,引发了该异常,但是我没有更改与此异常相关的任何内容。

I have a problem since I updated my App on playstore. Since this update, the exception is thrown, but I haven´t changed anything related to this exception.

Stacktrace:

Stacktrace:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.opiatefuchs.onthejobtimerlight/de.opiatefuchs.onthejobtimerlight.OnTheJobTimerActivity}: java.lang.ClassNotFoundException: Didn't find class "de.opiatefuchs.onthejobtimerlight.OnTheJobTimerActivity" on path: DexPathList[[zip file "/data/app/de.opiatefuchs.onthejobtimerlight-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "de.opiatefuchs.onthejobtimerlight.OnTheJobTimerActivity" on path: DexPathList[[zip file "/data/app/de.opiatefuchs.onthejobtimerlight-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
... 10 more
Suppressed: java.lang.ClassNotFoundException: de.opiatefuchs.onthejobtimerlight.OnTheJobTimerActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

问题是,我的App版本运行之前没有问题,并且我没有进行任何更改与这项活动有关。我刚刚添加了一个与该活动无关的新信息对话框。该应用程序是一个免费的精简版,我在专业版上进行了完全相同的更改,没有抛出任何异常。这按预期工作。
pro和lite之间的唯一区别是,我在lite版本中集成了Admob(以新方式),在pro版本中集成了Google Play许可。但是我从一开始就整合了这一点,并没有对此进行任何更改。
我也没有对清单进行任何更改,我在这里阅读了很多帖子,但没有任何帮助。

The thing is, my App version before runs without problems and I haven´t changed anything related to this activity. I´ve just added a new info dialog that has nothing to do with this activity. This app is a free lite version, I´ve made the exact same changes on the pro version and there nothing is thrown. This works as expected. The only difference between pro and lite is, I have integrated Admob (on the new way) in the lite version and Google Play license in the pro version. But this I have integrated since the beginning and haven´t made changes to this. I also haven´t made any changes to the manifest, I read many posts here but nothing helps.

似乎从5.0开始就在Android版本上发生。有谁知道这个问题可能导致什么或有同样的经历吗?

It seems that it just happen on Android versions since 5.0 . Has anybody an idea what this problem could cause or has anybody the same experiences? Is it possible that proguard just destroyed anything by obfuscating (also here, no changes)?

我没有发布任何代码,因为它对这个问题并不重要,就像我说的那样,proguard是否有可能通过混淆破坏了任何东西?我尚未对此异常进行任何更改。

I posted no code, because it is not important to this problem, like I said I haven´t made changes related to this exception.

此问题被标记为重复,但并非如此。带有链接的评论不能解决我的问题,所有库都已通过正确的方式检查和集成。另外,我不使用NDK。

This Question is marked as duplicate but it isn´t. The comment with the link doesn´t fix my problem, all libraries are checked and integrated in the right way. Also, I don´t use NDK.

推荐答案

更新



经过很长一段时间,事实证明,它必须与proguard有关。我不能说出错误的确切原因,但是我做了一点尝试,这就是我注意到的(在我的Eclipse IDE中):

Update

After a long time, It turned out that it must have anything to do with proguard. I can´t really say what exactly the error causes, but I tried a little bit and that´s what I noticed (that´s in my case with Eclipse IDE):


  • 我必须关闭要签署的项目中的每个选项卡

  • 我必须清理该项目,清理后除了导出apk之外什么也不能做

  • 在清单中进行少量更改,保存并撤消更改(并保存)

  • 如果清单中有任何用 YourClass命名的类或 .YourClass,将其更改为 com.yourpackage.yourClass

  • I have to close every tab from the project I want to sign
  • I have to clean the project and after cleaning, do nothing but export the apk
  • making a small change in manifest, save it and undo the change (and save)
  • if there is any class in manifest named with "YourClass" or ".YourClass", change it to "com.yourpackage.yourClass"

这是我所做的四点,然后工作了。这看起来很可疑,但是我认为混淆存在问题。因为不做这些事情,我可以简单地编译我的apk并从eclipse安装它。对我来说,没有明显的原因会发生这种情况。
如果我仅从eclipse安装软件包名称,它的名称也不会更改。
我希望这些要点可以对某人有所帮助。

That are the four points I have done and then it worked. This looks suspicious, but I think there is a problem with obfuscating. Because without doing these points, I can simply compile my apk and install it from eclipse. For me, there is no obvious reason for this behavior. Also the package name does work without a change if I only install it from eclipse. I hope these points can help somebody.

这篇关于ClassNotFoundException:在路径:DexPathList上找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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