2017-05-20 1 views
0

문제가 있지만 행운을 찾지 거의 하루가 걸렸습니다. 종속성의 중복으로 인해 발생했습니다. 아직 찾지 못한다. 실행 작업 실패 ': 응용 프로그램 : transformClassesWithJarMergingForDebug'java.util.zip.ZipException : 중복 항목 : org/apache/commons/collections/ArrayStack.class

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:[email protected]') { 
    transitive = true 
} 
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
    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:[email protected]' 
compile 'com.ogaclejapan.smarttablayout:utils-v4:[email protected]' 
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:[email protected]' 
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' 
} 

오류 내 build.gradle 파일 여기

.

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

+0

아마도 Android Studio를 사용하고 계실 겁니다. Ctrl-N을 눌러 ArrayStack 클래스를 검색 할 수 없으면 검색 결과에 포함 된 모든 라이브러리가 표시됩니다. –

+0

중복 클래스 파일을 제거하려면 어떻게해야합니까? –

+0

중복 라이브러리 중 하나를 제거하십시오. 또는 더 복잡한 솔루션은 종속성의 종속성을 제외하는 것이므로 전체 대신 충돌하는 부분 만 제거하는 것입니다. –

답변

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

은 평민 - 검증 의존성 때문에이 평민 - 컬렉션에있는 전이 의존성 인 ArrayStack의 두 가지 버전이 포함되어 있습니다.

선언에서 commons-collections를 제외하면 해당 라이브러리와 관련된 모든 클래스를 효과적으로 제거 할 수 있으며 실행시 ArrayStack 클래스 하나만 남습니다.

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

이 방법은 내 문제를 해결합니다. 내 하루 친구를 구 했잖아. –

+0

잘 듣고 싶습니다. 답변을 수락하면 문제가 해결 된 것으로 표시되므로 나중에 다른 사람들이 시도하고 대답 할 필요가 없습니다. –

관련 문제