``与OS无关的路径project.properties找到多个文件''android中的错误 [英] 'More than one file was found with OS independent path project.properties' Error in android

查看:74
本文介绍了``与OS无关的路径project.properties找到多个文件''android中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中添加了google translation api后,出现此错误.我正在使用Android Studio 3.0,Gradle 3.0.0.

I'm getting this error after I added google translate api on my project. I am using Android Studio 3.0, Gradle 3.0.0.

 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
 More than one file was found with OS independent path 'project.properties'

我尝试了此处,但没有成功.我也尝试将gradle降级到2.3版,但这也不能解决问题.

I have tried the solution presented here and here, but with no success. Also I tried downgrading gradle to version 2.3 but that didn't solve the problem either.

我的build.gradle文件:

My build.gradle file :

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'

}

有人可以帮我弄清楚是什么原因导致了此错误吗?

Can anyone help me figuring out what's causing this error?

推荐答案

添加以下行解决了我的问题:

Adding the following lines solved my problem:

packagingOptions {

        exclude 'project.properties'
        exclude 'META-INF/INDEX.LIST'
    }

这篇关于``与OS无关的路径project.properties找到多个文件''android中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆