Questions tagged [android-multidex]

Multidex is an Android technology that splits the classes of an Application (and its dependencies) into multiple dex files. (Dex being the format of the classes for the Dalvik/ART VM). Multidex is a workaround the 65 k maximal methods count inside a dex file.

Multidex is an Android technology that splits the classes of an Application (and its dependencies) into multiple dex files. (Dex being the format of the classes for the Dalvik/ART VM). Multidex is a workaround the 65k maximal methods count inside a dex file.

Package Summary

Features

Note that multidex is built-in in Art (Android SDK 5, Lollipop) and is also part of the support libraries

720 questions
487
votes
32 answers

Error:Cannot fit requested classes in a single dex file.Try supplying a main-dex list. # methods: 72477 > 65536

I want to add fused location services but it shows me some error. Help me. apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion "27.0.1" defaultConfig { applicationId…
Muhammad Adil Sattar
  • 4,871
  • 2
  • 9
  • 6
231
votes
16 answers

The number of method references in a .dex file cannot exceed 64k API 17

I am building an app with SugarORM Library but when I try to build the project for API 17 (didn't check for others) it shows build error. Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild…
168
votes
15 answers

How to enable multidexing with the new Android Multidex support library

I want to use the new Multidex support library to break the method limit for one of my apps. With Android Lollipop Google introduced a multidex support library that makes it easy to multidex. What steps are needed to use this library and to build…
Janusz
  • 187,060
  • 113
  • 301
  • 369
148
votes
4 answers

What is Android MultiDex?

There are many posts about MultiDex. I have experienced, sometimes, errors solved including multiDexEnabled true in the defaultConfig section of my build.gradle. But, what exactly is this feature? What are the scenarios for using it?
Roberto Tellez Ibarra
  • 2,146
  • 3
  • 18
  • 34
119
votes
20 answers

java.util.zip.ZipException: duplicate entry during packageAllDebugClassesForMultiDex

I am not sure what this error means. Execution failed for task ':excelSior:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/v4/util/TimeUtils.class I am currently using android-support-v4.jar for…
91
votes
12 answers

How to shrink code - 65k method limit in dex

I have a rather large Android app that relies on many library projects. The Android compiler has a limitation of 65536 methods per .dex file and I am surpassing that number. There are basically two paths you can choose (at least that I know of)…
Jared Rummler
  • 37,824
  • 19
  • 133
  • 148
74
votes
29 answers

Error:Execution failed for task ':app:transformClassesWithDexForDebug'

The error Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command…
65
votes
15 answers

Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList

I'm trying the new MultiDex Support on my app and so far I've managed to compile my app correctly, but when running it, I get the following exception: java.lang.RuntimeException: Unable to instantiate application…
Roberto Betancourt
  • 2,375
  • 3
  • 27
  • 35
63
votes
15 answers

Program type already present: BuildConfig

I'm trying to generate a release build but im not able because of mutidex issues my project has all the multidex enabled and dependencies added The error i'm receiving is : Execution failed for task…
Oussaki
  • 1,449
  • 2
  • 21
  • 30
42
votes
1 answer

Robolectric unit tests fail after Multidex

So I recently merged my robolectric 3.0 upgrade with our mainline, which had added multidex support to our application. Unfortunately, this had the unfortunate side effect of causing our tests to fail/not run - they'd simply stop after the first…
38
votes
12 answers

Android Studio 3.0 Beta 1: Failed to resolve: com.android.support:multidex:1.0.2

After migrating from Android Studio 3.0 (Canary 5) to Android Studio 3.0 (Beta 1), and moving to latest gradle , i.e. 'com.android.tools.build:gradle:3.0.0-beta1' When I try to gradle sync, it error stating below. Failed to resolve:…
Elye
  • 53,639
  • 54
  • 212
  • 474
38
votes
18 answers

"java.exe" exited with code 2 Xamarin.Android project

so I have my Xamarin.Android project which contains several libraries. When I try to build I receive an error which says "java.exe" exited with code 2. After some hours of google research I found out that I could enable Multidex. According to the…
Daniel_97
  • 891
  • 1
  • 8
  • 15
38
votes
5 answers

Getting "package android.support.multidex does not exist" after upgrading to Android Studio 2.3

I updated from Android Studio 2.2.3 to Android Studio 2.3 yesterday, and I ran into the following two problems: Upon updating, Gradle 3.2 was installed by default, but syncing my project would not work and I kept getting an error saying "Gradle…
34
votes
9 answers

INSTALL_FAILED_DEXOPT Error in Android 5.0 in Release mode

I have a strange issue with INSTALL_FAILED_DEXOPT . This occurs in android 5.0 devices in emulator as well as in devices. And strange thing is that it works well when build variant in Debug mode . If I change to Release I get this exception only on…
Rockin
  • 723
  • 4
  • 25
  • 51
29
votes
4 answers

Android - transform Classes With Dex For Debug

My project was working fine until I added the Facebook dependency. I've started getting this error. I've read many question, the problem seems to be related to MultiDex. But none of the solutions worked for me Error:Execution failed for task…
Haroun SMIDA
  • 1,106
  • 3
  • 16
  • 32
1
2 3
47 48