0

When I build the APP. The exception as following occurred.

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: 
org.gradle.process.internal.ExecException: 
Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' 
finished with non-zero exit value 2

Here is my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {

        applicationId "com.icreator.voicephoto4android"
        minSdkVersion 19
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile files('libs/android-async-http-1.4.6.jar')
    compile files('libs/android-support-v4.jar')
    compile files('libs/commons-httpclient-3.0.1.jar')
    compile files('libs/core.jar')
    compile files('libs/fastjson-1.1.34.jar')
    compile files('libs/qiniu-android-sdk-7.0.1.jar')
}
Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
X.Hal
  • 13
  • 2
  • Take a look at my answer... https://stackoverflow.com/questions/33980854/android-studio-appdexdebug-error/33980943#33980943 – Paresh P. Dec 01 '15 at 04:25

2 Answers2

0

I had the same issue about 5 days ago and i solved it using below method...

i add these lines to app (build.gradle) file

packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
    }

defaultConfig {
        applicationId "your package name here"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
Mustanser Iqbal
  • 5,017
  • 4
  • 18
  • 36
-2

Here is what you need bro. Java finished with non-zero exit value 2 - Android Gradle Comment all

//compile files('libs/android-async-http-1.4.6.jar')
//compile files('libs/android-support-v4.jar')
//compile files('libs/commons-httpclient-3.0.1.jar')
//compile files('libs/core.jar')
//compile files('libs/fastjson-1.1.34.jar')
//compile files('libs/qiniu-android-sdk-7.0.1.jar')

and it will run

Community
  • 1
  • 1
TuanDN
  • 7
  • 3