首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在android中找到多个文件时出现操作系统独立路径project.properties错误

在android中找到多个文件时出现操作系统独立路径project.properties错误
EN

Stack Overflow用户
提问于 2017-12-04 17:21:40
回答 0查看 22.1K关注 0票数 7

在我的项目中添加了google translate api后,我得到了这个错误。我使用的是Android Studio 3.0,Gradle 3.0.0。

代码语言:javascript
复制
 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
 More than one file was found with OS independent path 'project.properties'

我已经尝试了herehere提出的解决方案,但没有成功。此外,我还尝试将gradle降级到2.3版,但这也没有解决问题。

我的build.gradle文件:

代码语言:javascript
复制
android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.aim.fjalortest"
        minSdkVersion 16
        targetSdkVersion 25
        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 'META-INF/project.properties'
        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'
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    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.3.1'
    testCompile 'junit:junit:4.12'

    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
    compile 'com.android.support:recyclerview-v7:25.4.0'
    compile 'com.google.android.gms:play-services-vision:9.0.0+'
    compile 'com.android.support:design:25.4.0'
    compile 'com.google.cloud:google-cloud-translate:1.12.0'
    //annotationProcessor 'com.google.cloud:google-cloud-translate:1.12.0'

    //jackson
    compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5'
    compile 'com.fasterxml.jackson.core:jackson-core:2.8.5'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.5'

}

谁能帮我找出导致这个错误的原因?

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47630015

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档