本文介绍了错误:任务':java.util.zip.ZipException的执行失败:重复的条目:org/apache/commons/io/CopyUtils.class的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/commons/io/CopyUtils.class
发生此错误.
该应用程序构建成功,但是当我获得构建apk时,android studio会显示此消息
The app builds success but when I get build apk, android studio show this message
这是我的礼物
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25'
defaultConfig {
applicationId "com.example.thewell_dev.fourscompany"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.mobsandgeeks:android-saripaar:2.0.3'
compile 'com.koushikdutta.ion:ion:2.1.9'
compile 'gun0912.ted:tedpermission:1.0.2'
compile 'com.android.support:design:22.+'
compile 'com.estimote:sdk:0.13.0'
compile 'jp.wasabeef:glide-transformations:2.0.0'
compile 'com.afollestad:easyvideoplayer:0.3.0'
compile 'com.github.jrvansuita:PickImage:v2.0.0'
compile 'com.amazonaws:aws-android-sdk-s3:2.+'
compile 'com.mindorks:placeholderview:0.6.0'
compile 'com.tsengvn:Typekit:1.0.0'
compile 'com.github.esafirm:RxDownloader:1.0.1'
compile 'com.mlsdev.rximagepicker:library:1.1.2'
compile 'io.reactivex:rxjava:1.0.14'
compile 'com.kbeanie:image-chooser-library:1.5.2@aar'
compile 'com.kbeanie:image-chooser-library:1.5.8'
compile 'io.github.jeancsanchez.photoviewslider:photoviewslider:1.2.0'
compile 'com.nononsenseapps:filepicker:3.1.0'
compile 'com.gjiazhe:scrollparallaximageview:1.0'
compile 'com.droidninja:filepicker:1.0.8'
compile 'com.android.support:multidex:1.0.0'
}
我认为外部库有Commons-io-1.3.2.jarCommons-io-2.4.jar并且都具有CopyUtils.class
I think external libraries haveCommons-io-1.3.2.jarCommons-io-2.4.jarand both have CopyUtils.class
无论如何,它无法构建apk并显示该消息.
Anyway, It can't build apk and show that message.
请任何人帮助我
推荐答案
您已经集成了多个使用Apache Commons的依赖项.只需使用gradle中的以下代码排除它们即可.
There is more than one dependency you have integrated which uses Apache Commons.just exclude them using following code in gradle.
compile('YOUR_DEPENDENCY') {
exclude module: 'commons-io'
}
这篇关于错误:任务':java.util.zip.ZipException的执行失败:重复的条目:org/apache/commons/io/CopyUtils.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!