0

have a problem with gradle, my app wont compile and appear this error on "0:Messages" tab, here my code on my build.gradle(app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "app.nucleo.com.doctoc"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dexOptions {
    incremental = true;
    preDexLibraries = false
    javaMaxHeapSize "4g" // 2g should be also OK
}

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile project(path: ':backend', configuration: 'android-endpoints')
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.android.support:appcompat-v7:24.0.0-alpha2'
    compile 'com.android.support:support-v4:24.0.0-alpha2'
    compile 'com.android.support:design:24.0.0-alpha2'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-auth:8.4.0'
    compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.28'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
}

screenshot:

https://i.stack.imgur.com/6BTaw.png

any can help me?

2 Answers2

0

remove from your dependencies:

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

and look exactly for what else you need from play-services from here.

Mounir Elfassi
  • 2,242
  • 3
  • 23
  • 38
  • If you have fine-tuned the selected play services you can now remove the multidex=true and it'll work. At least in theory. – Tatarize Apr 20 '16 at 00:00
0

Fine tune your play-services so you don't include the entire package. Then it won't exceed the 64k function limit and you can remove the multidex thing that I assume you added because it was objecting.

multiDexEnabled false

And the exact play services so it all fits in the same same dex file.

Tatarize
  • 10,238
  • 4
  • 58
  • 64