Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finished with Non Zero Exit Value 3

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.

like image 221
Solomon Powell Avatar asked Apr 18 '15 17:04

Solomon Powell


4 Answers

Increased the HEAP size to 2g or 4g. Filename: build.gradle

android {
        defaultConfig {}

        dexOptions {
              javaMaxHeapSize "4g"
        }

        packagingOptions {
        }

        buildTypes {
        }
   }
like image 90
Uday Nayak Avatar answered Nov 15 '22 02:11

Uday Nayak


add this:

android {
    // Other stuffs
    dexOptions {
        javaMaxHeapSize "4g"
    }
}
like image 38
张立宾 Avatar answered Nov 15 '22 02:11

张立宾


I just change

"compile fileTree(dir: 'libs', include: ['*.jar'])"

to

"provided fileTree(dir: 'libs', include: ['*.jar'])".

It resolved my problem

like image 27
user1653510 Avatar answered Nov 15 '22 03:11

user1653510


Steps:

1.Go to your app build.gradle

2.include the following: dexOptions { javaMaxHeapSize "4g" }

like image 2
Hari Avatar answered Nov 15 '22 02:11

Hari