DexKnifePlugin icon indicating copy to clipboard operation
DexKnifePlugin copied to clipboard

已经添加到-keep的类依旧 NoClassDefFoundError

Open ab503044120 opened this issue 7 years ago • 3 comments

机器系统:4.4 我想在启动页面用multidex加载其他dex ,但是在application中就报错了 Uploading BaiduShurufa_2017-4-11_16-5-47.png…

ab503044120 avatar Apr 11 '17 08:04 ab503044120

你先检查下生成的 maindexlist.txt是否有你的类。 如果multidex不在application中加载,在multidex加载前的任何其他dex中的类都不能用。 你可能是keep的类中还有其他依赖的类未keep

ceabie avatar Apr 11 '17 09:04 ceabie

maindexlist.txt确实有那个类 我开启了 -split **.** 会不会有什么影响呢

ab503044120 avatar Apr 11 '17 09:04 ab503044120

-split . 是个比较危险的选项,你无法实时保证没有遗漏。这个需要你自行调试了,插件只能保证maindexlist中类存在,但不保证依赖链和mutildex加载时机问题。 你的问题可能是连 android.support.multidex.** 都没keep,或者依赖链出问题了,不是只有keep一个类就够了

ceabie avatar Apr 11 '17 10:04 ceabie