Android的摇篮插件multidex抛出:Zip​​Exception [英] Android gradle plugin multidex ZipException

查看:690
本文介绍了Android的摇篮插件multidex抛出:Zip​​Exception的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用新multidex的选择,但我得到了以下错误:

I'm trying to use the new multidex option but I get the following error:

Execution failed for task ':packageAll[Variant]TestClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/multidex/BuildConfig.class

我已经能够只发生在运行的 connectedAndroidTests 的任务时发现的问题,而不是在简单地建设项目(建立的)。

I've been able to discover the issue only happens when running the connectedAndroidTests task, and not when simply building the project (build).

推荐答案

这里有一个问题,对于这​​一点,而且它在多DEX库1.0.1解决,请参阅:的复制BuildConfig类重复BuildConfig类

There's an issue for this, and it's resolved in multi-dex library 1.0.1, see: Duplicate BuildConfig classes when using multidex test support

尝试:

compile 'com.android.support:multidex:1.0.1'
androidTestCompile 'com.android.support:multidex-instrumentation:1.0.1'

这篇关于Android的摇篮插件multidex抛出:Zip​​Exception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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