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
}

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...