1

Error:Gradle: Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/java/jdk1.8.0_73/bin/java'' finished with non-zero exit value 2
This Error comes in all my projects

build.gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.mukesh.airpollution"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

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

dependencies {
    compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1'
}

dependencies {
    compile 'com.android.support:recyclerview-v7:23.1.1'
}

dependencies {
    compile 'com.loopj.android:android-async-http:1.4.4'
}

dependencies {
    compile 'com.google.code.gson:gson:2.2.4'
}

dependencies {
    compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.google.maps.android:android-maps-utils:0.4+'
}
8
  • Post your build.gradle file. Commented Apr 24, 2016 at 10:31
  • This may be a multidex issue. Try to apply multidex support. see stackoverflow.com/questions/32407985/… Commented Apr 24, 2016 at 10:43
  • @MonishKamble added gradle file Commented Apr 24, 2016 at 10:51
  • @DevrimTuncer That is not always a solution... @ Martin, Please see this post Commented Apr 24, 2016 at 10:57
  • You really should condense all the dependencies sections... you only need a single one. Commented Apr 24, 2016 at 10:58

1 Answer 1

1

Try compacting your build.gradle as below (removed duplicate entry for httpclient) :

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.example.mukesh.airpollution"
    minSdkVersion 15
    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.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.maps.android:android-maps-utils:0.4+'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.loopj.android:android-async-http:1.4.4'
compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1'
}

Tell me whether it works?

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

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.