Android的gradle这个DexException:库DEX文件在多DEX模式下支持 [英] Android gradle DexException : Library dex files are not supported in multi-dex mode

查看:587
本文介绍了Android的gradle这个DexException:库DEX文件在多DEX模式下支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序最近达到64K限制。
我试图通过添加创建使用--multidex选择多个索引:

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 "$@"

在DX批处理文件。

在构建过程顺利但在完成运行的应用程序
它给了DexException:库DEX文件在多DEX模式支持

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.

推荐答案

- 多DEX 选项 DX 是pre-德兴库项目不兼容。所以,如果您的应用程序使用库项目时,需要<一个href=\"http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance.\"相对=nofollow>禁用pre-德兴才可以使用 - 多DEX

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.

这是说,我不知道为什么这发生在运行时。这显然​​是由 DX 工具暴露构建时失败。也许发生了什么事,你是该应用程序的部分从IDE中运行时,触发生成错误进行了重建。

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.

这篇关于Android的gradle这个DexException:库DEX文件在多DEX模式下支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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