3

I am using Android Gradle:3.0.0-beta-6 and it throws the following Error ever since I included Google Translation API.

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task 
':app:transformResourcesWithMergeJavaResForDebug'.

More than one file was found with OS independent path 'project.properties'

This is my dependencies

dependencies {
    annotationProcessor 'com.google.auto.value:auto-value:1.2'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1',
 {
  exclude group: 'com.android.support', module: 'support-annotations'
    })
    api 'com.twitter.sdk.android:twitter-core:3.1.1'
    api 'com.google.cloud:google-cloud-translate:1.6.0'
}

How can I fix this error and why exactly this is happening because I searched exhaustively for last 34 hrs and I didn't get an explanation.

Engineero
  • 12,340
  • 5
  • 53
  • 75
kndofded
  • 33
  • 1
  • 1
  • 4
  • Try to use `implementation` instead of `api`. [More info](https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html) – Eselfar Sep 26 '17 at 16:20
  • I used everything but it still doesn't work. Now, I'm making a REST API that can do what I want in Python and I'll call it in my app – kndofded Sep 27 '17 at 16:05
  • I've created a Test project and used your dependencies and it builds. Probably your issue is somewhere else as the error is `More than one file was found with OS independent path 'project.properties`. Do you have Modules or Jar that you've added to your project? – Eselfar Sep 27 '17 at 17:06
  • No, but Google Translation API uses few jar files – kndofded Sep 27 '17 at 18:00
  • 1
    I have no `project.properties` files in my project, the only one labelled like that by Android Studio is the `gradle.properties` one. I did a quick search and all the questions related to a file named `project.properties` concern Eclipse. So is it some legacy from Eclipse in your project? – Eselfar Sep 28 '17 at 08:38

1 Answers1

2

Have you tried adding this to your build.gradle?

android {
    ...
    packagingOptions {
        exclude 'META-INF/project.properties'
    }
}
Bernardo Rocha
  • 497
  • 4
  • 7
  • 18