0

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 2

My build.gradle (app):

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}

defaultConfig {
    applicationId "com.sevenlifes.way"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

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

testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse.bolts:bolts-android:1.3.0'
compile 'com.parse:parse-android:1.11.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.2'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services:8.3.0'
}

I tried:

defaultConfig {
    multiDexEnabled true
}

and this: https://developer.android.com/tools/building/multidex.html

But nothing helped.

It began after adding Google Map Api. Any idea?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Oleg Skidan
  • 617
  • 6
  • 24
  • Ok... I found an answer. http://stackoverflow.com/questions/32553245/android-studios-runtimeexception-unexpected-exception-in-dex-writer-thread – Oleg Skidan Nov 24 '15 at 19:18

1 Answers1

0
dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Oleg Skidan
  • 617
  • 6
  • 24