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+'
}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

1 Answers1

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?

Monish Kamble
  • 1,478
  • 1
  • 15
  • 28