当前位置: 首页 > 知识库问答 >
问题:

错误::在打包APK期间重复文件

查学文
2023-03-14

Android Studio。我在应用程序运行过程中遇到这种错误。

错误:任务“:app:PackageDebug”执行失败。APK meta-inf/notice.txt中复制了重复文件

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    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/ASL2.0'
    }

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:19.0.1'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'org.codehaus.jackson:jackson-core-asl:1.9.13'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
    compile 'com.octo.android.robospice:robospice:1.4.11'
    compile 'com.octo.android.robospice:robospice-spring-android:1.4.11'
}

已编辑

这些排除选项解决了我的问题:

packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }

共有1个答案

松钊
2023-03-14

我认为字符串比较是区分大小写的。尝试使用排除“meta-inf/notice.txt”

 类似资料: