I am trying to run my project, but I keep getting this error:
Error:Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
This is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.blume.android"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':endpoints-backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile project(path: ':cloud-backend', configuration: 'android-endpoints')
compile 'javax.persistence:persistence-api:1.0'
compile project(':endpoints-backend')
}
All Help is appreciated.
Increased the HEAP size to 2g or 4g. Filename: build.gradle
android {
defaultConfig {}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
}
buildTypes {
}
}
add this:
android {
// Other stuffs
dexOptions {
javaMaxHeapSize "4g"
}
}
I just change
"compile fileTree(dir: 'libs', include: ['*.jar'])"
to
"provided fileTree(dir: 'libs', include: ['*.jar'])".
It resolved my problem
Steps:
1.Go to your app build.gradle
2.include the following: dexOptions { javaMaxHeapSize "4g" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With