How fix Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Solution 1
Well, I got this issue because my project was imported from Eclipse to Android Studio and dependencies were missing in gradle.
I got rid of it after adding
useLibrary 'org.apache.http.legacy'
in
defaultConfig {
}
below
targetSdkVersion 25
After, this I had to set
minSdkVersion 9
Also, I added following lines
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
above
defaultConfig {
//code snippet
}
So, that it looks like,
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
applicationId "xxx.xxxx.xxxx.xxxx"
minSdkVersion 9
targetSdkVersion 25
useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
//remaining code snippet
//.....
}
//remaining code snippet
//.....
}
@tompok, you are getting this error maybe due to jar files you are using in dependencies may not be there.
Instead Google for their gradle dependencies and place the package name in place of path like it is in first line:
compile 'com.android.support:support-v4:19.1.0'
Replace remaining dependencies in the above format.
Hope, it will help you.
______________________________________
EDIT:
You are facing this problem since you are using buildToolsVersion 25.0.2
whereas library you are using is compile 'com.android.support:support-v4:19.1.0'
Just change it to compile 'com.android.support:support-v4:25.0.2'
and your issue will be solved.
Ask if you face any other issue else accept it as answer so it may help others.
Solution 2
I met this problem, after draw the left and bottom stratch line for .9 .png then it ok. Good luck.
Solution 3
Try code on your module build.gradle:
android {
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}
It means Android studio DO NOT check PNG strictly.
Solution 4
most of the time is a corrupt PNG image added recently to the project which cause this error. Check the git log and replace the file.
Sometimes menu : File > InvalidateCaches/Restart also helps
Solution 5
Well, I didn't got the solution when I used in android studio 3.1
android {
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}
Actually I'm in the process of importing the eclipse project to latest android studio. I spend around three day in searching for this specific error.
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error:Execution failed for task ':app:mergeDebugResources'.
I found some references from the following links...
- why i get Some file crunching failed after i rename drawable file to .9.png?
- Gradle throw app:mergedebugresources exception
After that I searched In the drawable for the images with the extension image_name.9.png
. and renamed it to image_name.png
. After that this error got disappeared. Again this worked for my project, still not sure about other causes for this problem. I hope that this may be useful for someone!
Admin
Updated on June 06, 2022Comments
-
Admin almost 2 years
I have a project in Eclipse and I export to gradle project and open in Android Studio when I sync project I get Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
This is my build.gradle :
apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.smok.maps" minSdkVersion 8 targetSdkVersion 19 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:19.1.0' compile 'joda-time:joda-time:2.3' compile files('libs/ksoap2-android-assembly-3.6.0-jar-with-dependencies.jar') compile files('libs/osmbonuspack_v4.9.jar') compile files('libs/osmdroid-android-4.2-javadoc.jar') compile files('libs/osmdroid-android-4.2.jar') compile files('libs/slf4j-android-1.5.8.jar') }