Too many dex files

烈酒焚心 提交于 2019-12-14 03:09:09

问题


When I build big multi module project, result apk contains a lot of dex files. 35 on debug version and 15 on release. Most of files has far less methods and references then 65k.

Is there any way to compact dex files?

I also analysed several famous applications from google, instagram, and others. They all have 4-6 almost full dexes. Nothing like we have. So looks like compaction is possible

We also suspect that such big amount of dex files can slowdown application startup. Is it the case?

When I run application on android 4 device, I can literally see in logs how dex files getting unpacked. I didn't profile it, but looks like the speed is more or less the same for every file, may be i wrong here.

AGP 3.4, Gradle 5.5

on debug version:

dex metrics on release version:

来源:https://stackoverflow.com/questions/57790068/too-many-dex-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!