25

please help me!

here is error says:

Error:Execution failed for task ':app:mergeDebugResources'.

Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

my app gradle is :

apply plugin: 'com.android.application'
android {
  compileSdkVersion 25
  buildToolsVersion "25.0.1"
  packagingOptions {
    exclude 'META-INF/NOTICE' // will not include NOTICE file
    exclude 'META-INF/LICENSE' // will not include LICENSE file
  }
defaultConfig {
    applicationId "com.aku.ec2ainun.stepondesign"
    minSdkVersion 18
    targetSdkVersion 25
    versionCode 1
    versionName "1.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
dexOptions {
    javaMaxHeapSize "4g"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}
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.0.1'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:multidex:1.0.1'
compile files('libs/slider.jar')
}
apply plugin: 'com.google.gms.google-services'

my project gradle:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
 }
}
allprojects {
  repositories {
    jcenter()
 }
}
task clean(type: Delete) {
   delete rootProject.buildDir
}
14
  • Please post the rest of the error message. The important part is in the beginning. Commented Dec 11, 2016 at 9:23
  • @NeriaNachum : here is all the console says : prnt.sc/di0brd Commented Dec 11, 2016 at 10:52
  • This is not the whole error. Copy the entire message in the left box. Commented Dec 11, 2016 at 11:14
  • @NeriaNachum: no, that all the error i have, here is the pic : prnt.sc/di7hzn Commented Dec 11, 2016 at 21:03
  • 1
    Try to modify 'com.android.tools.build:gradle:2.2.3' to 'com.android.tools.build:gradle:2.2.2' with your project gradle, and rebuild your project. There will be a more specific message. I think there are some log print bug exist in 2.2.3 release of gradle. Commented Dec 15, 2016 at 1:29

13 Answers 13

60

Try code on your module build.gradle:

android {
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}

It means Android studio DO NOT check PNG strictly.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Instead of switching jpg 2 png by renaming (works for web with a charm) I needed to properly convert it.
13

I got the same issue after I added 9 patch image in my project. Removing that image solved my problem.

1 Comment

I think problem is when we add .9 files and .png file with same name.Although removing .9 file in this case worked for me.
10

I got the same issue when I insert png image to drawable folder. I delete that image,clean project and rebuild it , the issue resolved.This worked for me.

Comments

4

Try to check that, if you use a 9-patch image, it is in correct format (with black pixel on the edge and they mustn't touch the pixel of your image). I resolved this problem with changing a 9-patch image that is malformed. In my case the image touched the black pixel of 9-patch e android studio showed that error.

Comments

2

I got this error when I added an image I had saved in gimp as 'filename.9.png' (which I thought was enough to produce a 9-patch image) to the drawable folder. To solve the issue I just opened the image in the Draw 9-patch tool and moved one of the bounds around - it didn't seem to matter whether I moved it back to the same spot, just the act of moving the bounds seems to correct the issue.

2 Comments

If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review
It wasn't a question, it's a resolution to the issue.
1

Some times I also get this error

Rebuilding the entire project before running (Build > Rebuild Project) it doesn't show up anymore.

You can try this.

Comments

1

I faced the same issue. I was using *.png files and the gradle Build kept on failing, despite multiple Rebuild-projects. Surprisingly, the moment I changed the file names from *.png to *.jpg, it worked!

Comments

1

After struggling a lot I have final solve this issue:

I realize two issue while solving this issue

  1. kindly check each and every XML file check each and every XML tag is properly close or not.
  2. Specially it appear with images kindly remove images and clean project.

Hope it will work for you.

Comments

1

After searching and using lots of suggestions i got a solution for this:

1)I am using nine patch images in my project and android studio doesn't accept abc.9.png image so rename this name to abc.png

2)When i am convert my images to nine patch images one image can't convert properly it shows "Bad Patches" i remove this image and recreate and i solved my problem, this problem is comes when i convert my project eclipse to android studio

3) put this in your gradle aaptOptions.setProperty("cruncherEnabled", false)

Thanks

Comments

0

Check your resources, specially the file names. It sucks when android studio does not point out the real reason. It solved my issue.

Comments

0

In my case I had one 9-patch resource in every screen density drawable folder. Black borders in every resource didn't match eachother so I stretched them up to the very corner, so they all matched.

This is the result:

This is the result.

And then it worked!

Comments

0

Just check Your String which contains another type of

 ( ' )colon ex/. we need ( ' )these but we implement like (’)these in app.

or any other string font.

Comments

-3

maybe the image issue which u put into the mipmap ,delete the image and retry the gradle sync 汉语 就是你放到mipmap中的图片有问题 把他删了就好了 哎 真为我的英语捉急啊~~

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.