0

I am developing an Android application and getting this error.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 2

I searched for this on google and come to know that this error comes if I exceeded the dex limit imposed by Android. I tried different suggested solutions like

defaultConfig {        
// Enabling multidex support.
multiDexEnabled true

}

and

dexOptions {
    preDexLibraries = false
    javaMaxHeapSize "4g"
}

But this cause other problems in my application. I am not using too much libraries in Gradle file but I don't know why this error coming. Here is my Gradle file

apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
    applicationId "ifisol.pinocal"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

repositories {

maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
maven {
    url "https://s3.amazonaws.com/repo.commonsware.com"
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
compile 'at.blogc:expandabletextview:1.0.1@aar'
compile project(':tedpicker')
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.hedgehog.ratingbar:app:1.1.2'
compile 'com.leavjenn.smoothdaterangepicker:library:0.2.0'
compile files('libs/gson-2.4.jar')
compile files('libs/picasso-2.5.2.jar')
compile 'com.google.android.gms:play-services:8.3.0'
}

I need to have a some solid solution to this problem because this problem has already wasted my one whole day. I will be very thankful for any kind of help.

Mehtab Ahmed
  • 499
  • 3
  • 16

0 Answers0