Gradle build error, Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'

匆匆过客 提交于 2019-11-30 00:09:16
AmmY

Try adding multiDexEnabled true to your app build.gradle file.

 defaultConfig {
    multiDexEnabled true
}

I did not try but It marked as answer at here

This is what worked for me, added it into build.gradle:

android {
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
        }
    }
Crazykulou

i had solve this issue,just add

packagingOptions{
   //  this is my setting:
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
  //  you should 
    exclude 'META-INF/license\LICENSE.base64.txt'
}
Red M

I was able to fix my problem by using packagingOptions into my build.grade under "app" folder. into that packagingOptions folder I did the following:

I EXCLUDED the message that was appearing on my grade.console whenever the project was failing.

For instance: if when your gradle console fails it says it could not execute because of META-INF/XXX so what you can do is

android { 

  packagingOptions  {

        exclude 'META-INF/XXX'
 }

Add it to the build.gradle under "app" folder.

Max Bykov

I used this combination

           buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled false
    }
}

and

buildToolsVersion "22.0.1"

with

compileSdkVersion 22
targetSdkVersion 22

and

   defaultConfig {   multiDexEnabled true}

And now my code compile for classpath 'com.android.tools.build:gradle:1.4.0-beta3' I try Vector graphics

After all answer tried can't work anyone, only work after invalid caches/restart press it work. mention that: Above answer that i include don't remove from my project.

 packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'

    }
 multiDexEnabled true

so that would be a answer.

Len

perform ./gradlew clean in your root project after adding

defaultConfig {
    multiDexEnabled true
}

I had the problem with some assets. In my case I had to downgrade the Gradle version to 1.2.3 and it worked again.

Excluding those files in my first attempt well...excluded the files from my app which didn´t make the thing.

Abet Sagaral

Update your dependencies:

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.0'
    **classpath 'com.android.tools.build:gradle:VERSION'**  Look for your build tools update
}

Path: /platforms/android/build.gradle

for other versions: go to android website https://developer.android.com/studio/releases/gradle-plugin.html#updating-plugin

Try doing: Invalidate caches and Restart.

It worked in my case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!