java.util.zip.ZipException:重复条目?

时间:2017-12-04 16:49:59

标签: java android android-studio android-gradle build.gradle

我是Android开发的新手,当我尝试生成签名的apk时,我目前看到以下错误。我不明白我错过了什么。

enter image description here

这是我的应用程序构建gradle在Android Studio中的样子

apply plugin: 'com.android.application'

repositories {
    jcenter()
    maven {
        url 'http://maven.localytics.com/public'
    }
}

android {
    dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
        preDexLibraries = false
    }
    configurations {
        all*.exclude group: 'org.apache.commons'
        compile.exclude group: 'org.jetbrains', module: 'annotations'
    }
    compileSdkVersion 25
    buildToolsVersion '26.0.2'
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 25
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
    }
}

dependencies {
    compile 'javax.xml.ws:jaxws-api:2.3.0'
    compile 'javax.xml.bind:jaxb-api:2.3.0'
    compile 'com.android.support:multidex:1.0.2'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile fileTree(include: 'HockeySDK*.jar', dir: 'libs')
    compile fileTree(include: 'bolts-*.jar', dir: 'libs')
    compile 'com.parse:parse-android:1.10.3'
    compile "com.android.support:appcompat-v7:25.4.0"
    compile "com.android.support:design:25.4.0"
    compile "com.android.support:percent:25.4.0"
    compile "com.android.support:support-vector-drawable:25.4.0"
    compile "com.android.support:animated-vector-drawable:25.4.0"
    compile "com.android.support:transition:25.4.0"
    compile "com.android.support:support-annotations:${supportLibVersion}"
    compile "com.android.support:palette-v7:25.4.0"
    compile "com.android.support:recyclerview-v7:25.4.0"
    compile 'com.github.clans:fab:1.6.4'
    compile 'com.android.volley:volley:1.0.0'

    compile 'com.google.android.gms:play-services-analytics:11.6.2'
    compile 'com.google.android.gms:play-services-maps:11.6.2'
    compile 'com.google.android.gms:play-services-gcm:11.6.2'

    compile 'com.squareup.picasso:picasso:2.5.2'

    compile 'org.igniterealtime.smack:smack-android-extensions:4.2.0-rc3'
    compile 'org.igniterealtime.smack:smack-experimental:4.2.0-rc1'
    compile 'org.igniterealtime.smack:smack-tcp:4.2.0-rc1'
    compile 'org.igniterealtime.smack:smack-sasl-provided:4.2.0-rc3'
    compile 'org.apache.commons:commons-io:1.3.2'
    compile 'com.daimajia.swipelayout:library:1.2.0@aar'
    compile 'com.orhanobut:dialogplus:1.11@aar'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    compile 'com.amazonaws:aws-android-sdk-core:2.6.9'
    compile 'com.amazonaws:aws-android-sdk-s3:2.6.9'
    compile 'com.amazonaws:aws-android-sdk-cognito:2.6.9'
    compile 'com.amazonaws:aws-android-sdk-pinpoint:2.6.9'
    compile('com.amazonaws:aws-android-sdk-mobile-client:2.6.9@aar') { transitive = true; }
}

我查看了我的依赖项,看到我有任何重复的条目,但无法找到任何内容。

1 个答案:

答案 0 :(得分:0)

从apk中排除该条目:


    android {
        ...
        packagingOptions {
            exclude 'module-info.class'
        }
    }