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

在APK中复制了重复的文件。Android系统

巫马心水
2023-03-14

我正在尝试发送一个文件到我的谷歌数据存储。当我尝试运行应用程序时,我会出现以下错误:

错误:任务“:app:TransformResourcesWithMergeJavaResforDebug”执行失败。

com.android.build.api.transform.transformException:com.android.builder.packaging.duplicateFileException:在APK com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanis.txt文件中复制了重复的文件1:c:\users\javier.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine

我尝试用

packagingOptions {
        exclude 'sep_approx_spanish.txt'
    }

但不管用。我的建筑.Gradle是下一个:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "com.example.javier.wh"
        minSdkVersion 23
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'sep_approx_spanish.txt'
    }
}

dependencies {
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.google.code.findbugs:jsr305:2.0.1'
    testCompile 'junit:junit:4.12'
    compile project(path: ':backend', configuration: 'android-endpoints')
    compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.34'
    compile 'com.google.appengine:appengine-endpoints:1.9.28'
    compile 'com.google.appengine:appengine-endpoints-deps:1.9.28'
    compile 'javax.servlet:servlet-api:2.5'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.guava:guava:19.0'
    compile 'com.googlecode.objectify:objectify:5.1.12'
}

有人也有同样的问题?救命啊!

共有1个答案

葛阳华
2023-03-14

在android block中的应用程序build.gradle

packagingOptions {
        pickFirst 'com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanish.txt'
 }
 类似资料: