Can't compile with Android Studio 1.3, gradle says the resource is already defined

Ever since I upgraded to Android Studio 1.3, I have had a very strange problem. When I try to start my apps, it tells me that:

"Gradle 2.4 requires Android Gradle Plugin 1.2.0 (or newer), but the project uses version 1.0.0. Please use Android Gradle Plugin 1.2.0 or newer."

When I click on "Fix plugin version and sync project" it changes this in my build.gradle files

dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0'
}

      

on this:

dependencies {
    classpath 'com.android.tools.build:gradle:1.2.3'
}

      

But I cannot start my app because of this resource (in my sw600dp / config.xml file):

<item name="is_tablet" type="bool">true</item>

      

It says that this resource is already defined in the auto-generated file "values-sw600dp-v13 / values.xml":

<resources>
    <!-- From: file:.../src/main/res/values-sw600dp/config.xml -->
    <eat-comment/>
    <item name="is_tablet" type="bool">true</item>
</resources>

      

(When I open this file it says "Files in the build folder are created and should not be edited").

If I comment, in the sw600dp / config.xml file a resource, it works, but it worked before, it shouldn't be said that it is already defined! And this happens in all my applications!

I've already tried:

FAILURE: Build failed, exception.

  • What went wrong: Failed to execute task ': app: processDebugResources'.

    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command' /Users/Library/Android/sdk/build-tools/21.1.2/aapt '' finished with non- zero exit value 1

  • I also tried to do "File> Invalid Caches / Restart"

None of this worked!

What can I do?

(I am using MAC)

Thanks a lot in advance !

+3


source to share


1 answer


This is caused by changes in the way AAPT compresses resources, it now fails if there are identically named resources in any library you might have included in the project (only .aar dependencies can contain resources).



The solution is to find where the conflict is coming from and exclude it from the project.

+3


source







All Articles