Alexander N.
Alexander N.

Reputation: 1592

Gradle build failing with TransformException

My gradle.build file looks like this:

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"

        defaultConfig {
            applicationId "com.example.alexandernohe.mapsappgoogle"
            minSdkVersion 16
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }
        packagingOptions {
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE-FIREBASE.txt'
            exclude 'META-INF/NOTICE'
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.2.1'
        compile 'com.google.android.gms:play-services:8.4.0'
        compile 'com.google.maps.android:android-maps-utils:0.4.3'
        compile 'com.firebase:firebase-client-android:2.5.1+'
        compile 'com.android.support:support-v4:23.2.1'
        compile 'com.android.support:design:23.2.1'

    }

I have enabled multidexing and have tried deleting the app/build folder but my application still will not build. If I remove the design library it will build but then I am unable to use a floating action button in my fragment, nor a coordinated layout. Most of the current solutions on here reference posts to enable multidexing, however, looking at the build file, you should see that it is enabled. I have a feeling that a library listed may overlap with the design library but as far as I can tell based upon googles documentation, they are different.

Here is the error code:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. >com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3

EDIT: I forgot to mention, I have also performed a clean on the project as well.

Upvotes: 0

Views: 501

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317412

Try this inside the android block of your build.gradle:

dexOptions {
    javaMaxHeapSize "4g"
}

Upvotes: 2

Related Questions