Find your content:

Search form

You are here

What is MultiDex in Android?

 
Share

What is MultiDex in Android?

Dex stands for Dalvik Executable, which is what Google's virtual machine processor (Dalvik) uses to handle Android Applications. Android was built with small and simple apps in mind and the constraints on one single Dalvik Executable pinned the roof of code references at 65,536 methods. Because of this issue and the way the Dalvik machine handles code execution there were some compiling and invocation issues, until the Monkey Patch or MultiDex integration. MultiDex integration in Android Studio allows Android Developers the ability to compile and execute a code-base with over 65,536 methods!

 

An android application program is compiled into a .dex file which in turn zipped to a single .apk file.
DVM (Dalvik Virtual Machine) uses .dex file/files to execute bytecodes.

What causes the number of references to exceed 65,536 limits?
Methods written by you + Android Framework methods + Third party library(eg Volley,Retrofit, Facebook SDK etc) methods.
I have read "somewhere"
App Compat 24.2.1 contains 16.5k methods
Google Play Services GCM 9.6.1 contains 16.7k methods
So if you have created a simple Hello world application which has App Compat 24.2.1, you are already 1/4 way to cross the single dex methods limit

 

 

 

My Block Status

My Block Content