且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

multidex-启用了multidex的NoClassDefFoundError

更新时间:2021-09-21 06:36:28

我们在这里进行了更深入的研究:

We had a deeper look at this here:

https://issuetracker.google.com/issues/131100011

不幸的是,在21之前的设备上的某些Dalvik VM中存在一个错误,该错误中的包私有方法有时会被另一个包中的公共方法错误地覆盖.如果程序包的私有方法是最终的,则将导致以下形式的错误:

There is an unfortunate bug in some Dalvik VMs on pre-21 devices where package private methods were sometimes incorrectly overriden by public methods in another package. If the package private method is final, that will then lead to errors of the form:

E/dalvikvm: Method Lcom/mycompany/MyViewModel;.clear overrides final Landroidx/lifecycle/ViewModel;.clear

在这里看来,这可能是打击您的原因.不幸的是,针对该特定问题的唯一解决方法是将您的清除"方法重命名为其他名称,以便您不会遇到该不幸的VM错误.

It looks like that could be what is hitting you here. Unfortunately, the only workaround for that particular issue is to rename your "clear" method to something else so that you do not hit this unfortunate VM bug.