Android gradle DexException : Library dex files are not supported in multi-dex mode

老子叫甜甜 提交于 2019-12-11 22:16:29

问题


My application reached the 64k limit recently. I tried to create multiple dexes using --multidex option by adding :

exec java $javaOpts -jar "$jarpath" --multi-dex "$@"

in dx batch file.

While the build process completed successfully but upon running the application it gave DexException : Library dex files are not supported in multi-dex mode

Now what does this mean ? I searched google for this but could not find anything useful.


回答1:


The --multi-dex option to dx is incompatible with pre-dexing library projects. So if your app uses library projects, you need to disable pre-dexing before you can use --multi-dex.

That said, I have no idea why this occurred to you at runtime. This clearly is a build time failure exposed by the dx tool. Maybe what happened to you is that parts of the app were rebuild when running from the IDE, triggering the build error.



来源:https://stackoverflow.com/questions/25696933/android-gradle-dexexception-library-dex-files-are-not-supported-in-multi-dex-m

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