提问者:小点点

java.util.zip.ZipException:重复条目:org/apache/Commons/集合/ArrayStack.class


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

在我的身体里。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”的执行失败。

通用域名格式。Android建筑应用程序编程接口。使改变TransformException:java。util。拉链ZipException:重复条目:org/apache/commons/collections/ArrayStack。班


共2个答案

匿名用户

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

commons validator依赖项包含两个版本的ArrayStack,因为它对commons集合具有可传递的依赖性。

通过在声明中排除Commons集合,您可以有效地删除与该库关联的所有类,并且在运行时只剩下一个ArrayStack类。

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

匿名用户

在我的情况下,以下解决方案对我有效:

刚刚添加到myProject/app/build中。android{}中的gradle

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

然后:同步-