tompok tompok - 1 year ago 219
Android Question

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

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')
}

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download