java.util.zip.ZipException : duplicate entry: org/apache/commons/collections/ArrayStack. 类

标签 java android

花了将近一天的时间搜索这个问题,但没有运气。这是由于依赖项冗余造成的。还没有找到哪个重复的。

在我的 build.gradle 文件中

apply plugin: 'com.android.application'

android {

defaultConfig {
    applicationId "com.ujjwalmainali.univhub"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 8
    versionName "1.1"
    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true
}

configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'

}


packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/ECLIPSE_.SF'
    exclude 'META-INF/ECLIPSE_.RSA'
}


compileSdkVersion 25
buildToolsVersion '25.0.2'


buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

 repositories {
  maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-
Android/master/" }
}

dependencies {
testCompile 'junit:junit:4.12'

//iconify dependencies



compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2' // (v4.5)

compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.sendbird.sdk:sendbird-android-sdk:3.0.25'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'net.gotev:uploadservice-okhttp:3.0.3'
compile 'com.jaredrummler:material-spinner:1.1.0'
compile 'com.nononsenseapps:filepicker:4.1.0'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.0'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'io.github.kobakei:ratethisapp:1.2.0'
compile 'com.github.paolorotolo:appintro:4.1.0'


//webview
compile 'com.thefinestartist:finestwebview:1.2.7'

//for android drawer
compile('com.mikepenz:materialdrawer:5.8.1@aar') {
    transitive = true
}
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.4@aar'){
    transitive=true
}


compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'commons-validator:commons-validator:1.4.1'
//for the calender date picker supports other type picker also like radial time picker,recurrence picker
compile 'com.code-troopers.betterpickers:library:3.1.0'
compile 'com.mikepenz:actionitembadge:3.3.1@aar'
compile 'com.mobsandgeeks:android-saripaar:2.0.1'
compile 'com.nightonke:boommenu:2.0.9'





compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'

compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'



//circular progress bar
compile 'com.victor:lib:1.0.4'

//app crash report
compile 'ch.acra:acra:4.9.0'

ext.googlePlayServicesVersion='10.0.1'
ext.supportLibraryVersion='23.1.1'

provided 'org.glassfish:javax.annotation:10.0-b28'

apply plugin: 'com.google.gms.google-services'
}

错误:任务“:app:transformClassesWithJarMergingForDebug”执行失败。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/commons/collections/ArrayStack.class

最佳答案

compile 'commons-validator:commons-validator:1.4.1'

commons-validator 依赖项包含两个版本的 ArrayStack,因为它对 commons-collections 具有传递依赖项。

通过在声明中排除 commons-collections,您可以有效地删除与该库关联的所有类,并且在运行时仅保留一个 ArrayStack 类。

compile('commons-validator:commons-validator:1.4.1') {
    exclude module: 'commons-collections'
}

关于java.util.zip.ZipException : duplicate entry: org/apache/commons/collections/ArrayStack. 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44083860/

相关文章:

java - BouncyCasSTLe 加密 - 丢失 "END PGP MESSAGE"

android - 在 android 上设置 Google maps API v2,错误膨胀类 fragment

java - servlet 中似乎没有正确捕获 id 值

java - 无法从 ant 脚本调用 wsdl 代码生成器

java - 从 Api 加载图像并缓存它

java - 错误 : no suitable constructor after update Android Studio from 0. 6.1 到 0.8.9

android - 你能在 "long press power button"菜单中注册一个应用程序吗?

java - 在其他java文件中声明多个字符串

android - BB10 中的推送通知

java - 如何让 Maven 3.0.4 使用 Java7?