0

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_77.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

what should i do? i do not have multiple copies of firebase-client in libs. its only present in external library.

my dependencies:

 compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'com.android.support:support-v4:23.2.1'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
    compile 'com.firebase:firebase-client-android:2.5.2+'
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
pooja
  • 3
  • 4

3 Answers3

1

Your problem is that you included too many dependencies and exceeded the multidex limit.

This line...

compile 'com.google.android.gms:play-services:8.4.0'

If you read this documentation, there is a note

Note: If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them. For information on how to do this, see Selectively compiling APIs into your executable.

You have already included the Google Maps API, so do you need any more Google Services than that? If so, pick those services from the link at the end of that note and remove that line I mentioned above.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
0

Just remove the + sign and clean and rebuild your project or try this dependencies and also check on stack overflow answer, com.android.build.transform.api.TransformException

   apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        //your application id here
        applicationId "yourapp.com.demoapps"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    dexOptions {

        javaMaxHeapSize "4g"
    }
    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.android.support:design:23.2.1'
     compile 'com.android.support:support-v4:23.2.1'
     compile 'com.google.android.gms:play-services:8.4.0'
     compile 'com.google.android.gms:play-services-maps:8.4.0'
     compile 'com.parse.bolts:bolts-android:1.4.0' 
     compile 'com.parse:parse-android:1.13.0' 
     compile 'com.firebase:firebase-client-android:2.5.2'
            }
Community
  • 1
  • 1
Muhammad Waleed
  • 2,517
  • 4
  • 27
  • 75
-1

It may be external library is not included correctly or try to use alternative library.

Nouman Shah
  • 534
  • 1
  • 9
  • 22