错误:任务':app:transformClassesWithJarMergingForDebug'执行失败。 >建立APK时

时间:2018-01-09 10:18:36

标签: java android build apk

  

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android / support / v7 / util / AsyncListUtil.class

我在尝试构建apk时遇到此错误。应用程序正在成功编译,Apk没有构建

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})


compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.google.code.gson:gson:2.4'
compile 'org.apache.karaf.http:http:3.0.5'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.google.android.gms:play-services:11.0.4'

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support:customtabs:26.0.1'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile('com.facebook.android:facebook-android-sdk:4.23.0')
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = 
true }
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile project(':adcolony-sdk-3.1.2')
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
}

1 个答案:

答案 0 :(得分:0)

尝试在第compile 'com.android.support:support-v4:26.0.1'行将v4更改为v7,如下面的代码

     dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.android.support:design:26.0.1'
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    compile 'com.google.code.gson:gson:2.4'
    compile 'org.apache.karaf.http:http:3.0.5'
    compile 'com.android.support:support-v7:26.0.1' //change here
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.google.android.gms:play-services:11.0.4'

    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.android.support:customtabs:26.0.1'
    compile 'com.firebaseui:firebase-ui-auth:2.3.0'
    compile('com.facebook.android:facebook-android-sdk:4.23.0')
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = true }
    compile 'com.google.android.gms:play-services-ads:11.0.4'
    compile 'com.google.android.gms:play-services-location:11.0.4'
    compile project(':adcolony-sdk-3.1.2')
    compile 'com.squareup.picasso:picasso:2.5.2'
    testCompile 'junit:junit:4.12'
}

<强>更新

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

清理并重建。