com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: 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'
}
最佳答案
尝试在 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"
}
}
}
清理并重建。
关于java - 构建 APK 时出现错误 :Execution failed for task ':app:transformClassesWithJarMergingForDebug' . >,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48165950/