Storg Storg - 1 year ago 260
Android Question

Error:The number of method references in a .dex file cannot exceed 64K.6

I want to build apk file, but i cant, because i have 2 errors. I tried lots of solutions, for example multiDexEnabled true or something like that, but didnt work.. Please help:)


Error:The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at
:app:transformClassesWithDexForDebug FAILED

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. java.util.concurrent.ExecutionException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_92\bin\java.exe'' finished with non-zero exit value 2


apply plugin: ''

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
applicationId "sgtt.celtkituzes_0_1"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''
dexOptions {
incremental true
javaMaxHeapSize "4g"

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile ''
compile ''
compile 'com.backendless:backendless:'
compile ''
compile ''
compile 'com.firebaseui:firebase-ui-database:0.5.1'
compile ''
apply plugin: ''

Answer Source

You shouldn't ever be using compile '' as that includes every Google Play services library - only use the APIs you need.

This should reduce your method count enough to fit under the 64K limit.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download