Jar merging for debug throwing duplicate entry with android?

淺唱寂寞╮ 提交于 2019-12-23 16:15:14

问题


Im getting this error when trying to run my build:

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

Here is my 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'
    }

Here is a pic of my libs

Im hoping someone here can help me find out what the issue is. Im using android studio.


回答1:


Try excluding the support-v4 since the google-play-services already contains the support-v4

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

if it doesn't work, Clean the project and rebuild it.

Else, try setting multiDexEnabled in the gradle file

defaultConfig {
    multiDexEnabled true
}


来源:https://stackoverflow.com/questions/33487780/jar-merging-for-debug-throwing-duplicate-entry-with-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!