0

I wanted to add the Floating button library to the dependencies of my android app. Fact is, after using it and adding to the build.gradle, the build fails. I thought, at first, it was something about its dependencies, so I looked up them and tried to exclude them, only to no avail.

The build fails on task app:dexDebug, with the following error line

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 2

This is my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.grebeteam.myuniversity"
        minSdkVersion 19
        targetSdkVersion 22
        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 'com.android.support:appcompat-v7:22.1.1' //make build fails on 22.2.1, not related
    compile 'com.google.android.gms:play-services:7.3.0' //make build fails on 7.5.0, not related
    compile 'com.google.apis:google-api-services-calendar:v3-rev121-1.20.0'
    compile 'com.google.api-client:google-api-client:1.20.0'
    compile 'com.google.api-client:google-api-client-android:1.20.0'
    compile 'com.google.api-client:google-api-client-gson:1.20.0'
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile ('com.melnykov:floatingactionbutton:1.3.0'){

        exclude module:"library"
        exclude module:"support-annotations"
        exclude module:"recyclerview-v7"
        exclude module:"support-v4"
    }


}

allprojects {
    gradle.projectsEvaluated {
       tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:deprecation"
       }
    }
}

while this is the Floating Button Library build.gradle

Am I missing something or am I doing something wrong? Thanks a lot for your time.

EDIT: This is my project level build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
fedexist
  • 155
  • 2
  • 12
  • What version of gradle are you using? Located in your project level build.gradle file. It may be helpful to post that file as well. – blackcj Aug 05 '15 at 16:08
  • @blackcj version is 1.2.3, i posted the whole file, just in case someone else needs it – fedexist Aug 05 '15 at 16:18
  • 1
    That google-api-client library looks huge. You may be hitting the dex limit. See this post: https://stackoverflow.com/questions/28640314/android-studio-fails-to-debug-with-error-org-gradle-process-internal-execexcepti – blackcj Aug 05 '15 at 16:29
  • yes, adding multiDexEnabled true to defaultConfig worked – fedexist Aug 05 '15 at 16:42
  • You really shouldn't be using `'com.google.android.gms:play-services:7.3.0'` - use the [split APIs](https://developers.google.com/android/guides/setup#split) as they are much, much smaller. – ianhanniballake Aug 05 '15 at 16:50
  • @ianhanniballake thanks for your suggestion, I'll use them – fedexist Aug 05 '15 at 17:01

0 Answers0