• Register
0 votes
1.2k views

Problem :

Currently I am using the Android Studio 2.1 but when I try to run it the suddenly my App shows me the below error Message my Gradle Build saying the following

Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.
java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46
)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskEx
ecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExec
uter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.j
ava:52)

 

7 5 2
3,870 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

I had faced the same error recently. I researched on it and found the solution on it.

In your individual apps's build.gradle, section android {}, you need to insert the below code:

aaptOptions {  
cruncherEnabled = false  
} 

This code fixed my issue.

OR

My problem was the crashed png image in one of the drawable folders. I mean a image like which we sometime face in our windows photo viewer. I had just dropped the image from my folder and my all problems got solved.

OR

Actually when something goes wrong with your image file then you need to go to (drawable) and just remove image or replace it with new image. This will solve your problem.

In addition to that you can put the method in (build.gradle), This will solve the problem and good way to catch up what was wrong. Also in your build.gradle, section android {}insert (cruncherEnagle = false)apptOptions.

9 7 4
38,600 points
0 votes

Solution:

In the separate apps's build.gradle, section android {}, insert :

aaptOptions {  
    cruncherEnabled = false  
}  

Attempt running gradle from command line:

gradle clean build --debug

And post your log later.

Only inspect this link - Android Studio - mergeDebugResources exception and libpng error: Not a PNG file Error displaying In Android Studio

You can attempt this command as well sudo apt-get install lib32stdc++6 on the console in case you are performing on a linux machine, then restart android studio and run your project

For me, it was a corrupted PNG file. Go to your res folder and attempt to open every images.

Really, image file something wrong. Go to (drawable) and remove image or replace with new image.This will resolve issue.

In addition, you can place method in (build.gradle), however This will not solve the problem however good way to catch up what was wrong.

In build.gradle, section android {}, insert (cruncherEnagle = false)apptOptions

we have to add dependency

 compile 'com.google.android.gms:play-services-auth:8.3.0' 

in app-level build.gradle file however doing so and building project an error comes saying

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.

build.gradle(Module:app)

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.brainbreaker.socialbuttons"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.google.android.gms:play-services-auth:8.3.0'
}

 

10 6 4
31,120 points

Related questions

0 votes
1 answer 613 views
613 views
Problem : I am facing the gradle error at the building from few days it just came randomly. My project depends on the multiple libraries and it built without the problems until few days (even with a libraries) ... .gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter$1.run(CacheLockReleasingTaskExecuter.java:40) at org.gradle.internal.Factories$1.create(Factories.java:26)
asked Jan 30, 2020 jwilliam 3.9k points
0 votes
1 answer 7 views
7 views
Problem What should I do to solve this problem, "org.gradle.api.tasks.taskexecutionexception: execution failed for task :app:mergedebugresources?"
asked Apr 7 salim1 60.6k points
1 vote
1 answer 395 views
395 views
Problem : After updating my android studio, I am facing below error. How can I fix this error?? org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures. at org.gradle ... .execute(SessionFailureReportingActionExecuter.java:63) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:53)
asked Dec 11, 2019 alecxe 7.5k points
0 votes
1 answer 17 views
17 views
Problem: how can solve this question please solve it... the two build files generated by android studio are in ________________.
asked Apr 1 Ifra 36.4k points
0 votes
1 answer 11 views
11 views
Problem: I get this error in my Logcat: Manifest merger failed with multiple errors, see logs that I have Linked with it
asked Mar 17 ummesalma 29.2k points
0 votes
1 answer 138 views
138 views
Problem: re-download dependencies and sync project (requires network)
asked Feb 16 Ethan ross 2.7k points
0 votes
1 answer 3 views
3 views
Problem: What is the solution? > Execution failed for task ':app:checkdebugduplicateclasses'.
asked 5 hours ago Irenka Kiri 4.9k points
0 votes
1 answer 55 views
55 views
Problem: execution failed for task ':app:compiledebugjavawithjavac'
asked Feb 18 charles mathews 5.5k points
0 votes
1 answer 46 views
46 views
Problem : I am new to Android Programming. I have started working on it recently. Now I am facing below error message. Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.transform.api.TransformException: com.android.ide.common. ... have added too many Gradle dependencies, but all those dependencies are important for my project. Have anybody faced this issue?
asked Feb 28, 2020 mphil 2.3k points
0 votes
1 answer 95 views
95 views
Problem : I am new to Android. Recently I have installed the Android studio 3.1.3 and it started giving me the dependencies error if tried to make the new project and tried to compile for the first time. “Unable to resolve dependency for ':app@debug/compileclasspath': could not resolve project”
asked Feb 18, 2020 mphil 2.3k points