Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException

I am building my android project when i got this error after import docx4j library in my project. What should i do to get rid of this exception.

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 2

like image 342
Wahib Avatar asked Apr 05 '15 18:04

Wahib


2 Answers

Add this to your file build. gradle

defaultConfig {
     multiDexEnabled true 
}
like image 96
souttab Avatar answered Oct 11 '22 12:10

souttab


The Android plugin for Gradle available in Android SDK Build Tools 21.1 and higher supports multidex, so you have to add multiDexEnabled true to your gradle file like below :

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"

    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...

        // Enabling multidex support.
        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}
like image 26
serabile Avatar answered Oct 11 '22 12:10

serabile