任务 ':packageAllDebugClassesForMultiDex' 执行失败 [英] Execution failed for task ':packageAllDebugClassesForMultiDex'

查看:40
本文介绍了任务 ':packageAllDebugClassesForMultiDex' 执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为一个项目使用新的 android multidex 支持.我对此异常有一些问题:

I am try to use the new android multidex support for a project. I have some problem with this exception:

错误:任务:shineV3:packageAllDebugClassesForMultiDex"的执行失败.

Error:Execution failed for task ':shineV3:packageAllDebugClassesForMultiDex'.

java.util.zip.ZipException:重复条目:com/google/android/gms/analytics/internal/Command$1.class

java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command$1.class

关于问题.我使用 2 个不同的 jar 包作为依赖项,并且某些类将在 classes.dex 中重复,因为两个 jars 都包含它们.任何的想法?提前致谢

about the problem. I use 2 different jar package as dependency, and some class will be duplicated in classes.dex because both jars contains they. any idea? thanks in Advance

推荐答案

对于那些进入这个领域的人,我想出了为什么会这样.对我来说,我正在编译 Google Analytics V2 jar 以及完整的播放服务.Google 允许您分解应用程序真正需要的播放服务并编译这些单独的项目.在此处查看它们.我排除了现在在 V4 上的 Google Play Analytics 并且它有效

For those that are coming into this, I figured out why this was happening. For me it was that I was compiling the Google Analytics V2 jar as well as the full play services. Google allows you to break down what play services you really need for you app and compile those individual items. Check them out here. I excluded the Google Play Analytics which is on V4 right now and it worked

这篇关于任务 ':packageAllDebugClassesForMultiDex' 执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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