微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java-Jar合并进行调试,从而与Android抛出重复项?

我在尝试运行构建时收到此错误

    Error:Execution Failed for task ':app:transformClassesWithJarMergingForDebug'.> com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/AnimatorRes.class

这是我的build.gradle

dependencies {
        compile filetree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.0'
        compile 'com.android.support:design:23.1.0'
        compile('com.digits.sdk.android:digits:1.9.0@aar') {
            transitive = true;
        }
        compile 'com.parse.bolts:bolts-android:1.+'
        compile 'com.parse:parse-android:1.+'
        compile 'com.android.support:cardview-v7:23.1.0'
        compile 'me.zhanghai.android.materialprogressbar:library:1.0.2'
        compile 'com.android.support:support-v4:23.1.0'
        compile 'com.google.android.gms:play-services-identity:8.1.0'
        compile 'com.google.android.gms:play-services-plus:8.1.0'
        compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
        compile 'com.anjlab.android.iab.v3:library:1.0.+@aar'
    }

这是我的肖像

enter image description here

我希望这里有人可以帮助我找出问题所在.我正在使用android studio.

解决方法:

请尝试排除support-v4,因为google-play-services已包含support-v4

compile ('com.google.android.gms:play-services:8.1.0')
{
     exclude group: 'com.android.support', module: 'support-v4'
}

如果不起作用,
清理项目并重建它.

否则,请尝试在gradle文件中设置multiDexEnabled

defaultConfig {
    multiDexEnabled true
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐