TransformException:java.util.zip.ZipException:重复条目:org / apache / http / message / BasicHeaderElementIterator.class

时间:2016-04-25 13:45:18

标签: android gradle apache-httpcomponents

我收到此错误:

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

  

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org / apache / http / message / BasicHeaderElementIterator.class

以下是我的应用级 build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.chaitanya.livio"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

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

}




dependencies 
{

    compile fileTree(include: ['*.jar'], dir: 'libs')
     testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile('org.apache.httpcomponents:httpcore:4.4.4') {
        exclude module: "httpmessage"
    }
    //compile ('org.apache.httpcomponents:httpclient:4.5.2')
    compile 'com.android.support:multidex:1.0.1'
    compile 'org.apache.httpcomponents:httpmime:4.5.2'
    compile 'org.apache.httpcomponents:httpclient:4.5.2'
}

我尝试检查所有冗余库,但仍然没有找到重复的类。我是Android编程的新手,无法理解为什么我会收到此错误。

0 个答案:

没有答案