Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build failed with an Exception

I am quite new to the studio,

I am trying to Run my application

Error is encountered -

What went wrong:

Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

I tried with jdk 1.8 which gave the same error.

So found few answers which said to reduce jdk to 1.7

but the Error still persists

Please Suggest what to do

Gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.1"
    defaultConfig {
        applicationId "innovapptive.com.mworkorder"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.0.0'

}
like image 781
lalita Avatar asked Jan 27 '26 06:01

lalita


2 Answers

This is what worked for me taken from this answer:

defaultConfig {
   multiDexEnabled true
}
like image 141
Horatio Avatar answered Jan 30 '26 00:01

Horatio


What worked for me was: Build-> Rebuild Project

like image 36
Michael Fretz Avatar answered Jan 29 '26 23:01

Michael Fretz