java.util.zip.ZipException : duplicate entry?

标签 java android android-studio android-gradle-plugin 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; }
}

我查看了我的依赖项以查看是否有任何重复的条目,但找不到任何内容。

最佳答案

从 apk 中排除该条目:


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

关于java.util.zip.ZipException : duplicate entry?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47638149/

相关文章:

java - 损坏的文件处理

java - 无法解析方法 getChildren.addAll();

Java:我可以有一个具有 3 个数组列表作为其值的 Map 吗?

java - 如果生命游戏中的语句重置板而不是遵守规则

android - 如何在jetpack compose中创建具有静态值的可扩展 ListView

安卓错误 :Configuration with name 'default' not found

android - 在 Linux 操作系统上为 Android 构建 pjSIP 不会创建 .so 文件

android - 这段使用 parse.com 数据库存储数据的 Android 代码有什么问题

android - 渲染问题 渲染期间引发异常 : Could not find layout resource

android - Android Studio Screen Record 中 Device Art 中的帧视频