Enabling Multidex
suggest changeIn order to enable a multidex configuration you need:
- to change your Gradle build configuration
- to use a
MultiDexApplication
or enable the MultiDex in yourApplication
class
Gradle configuration
In app/build.gradle
add these parts:
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 24
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
Enable MultiDex in your Application
Then proceed with one of three options:
- http://stackoverflow.com/documentation/android/1887/multidex-and-the-dex-method-limit/6003/multidex-by-extending-application#t=20160807053003773542
- http://stackoverflow.com/documentation/android/1887/multidex-and-the-dex-method-limit/18691/multidex-by-extending-multidexapplication#t=20160807053003773542
- http://stackoverflow.com/documentation/android/1887/multidex-and-the-dex-method-limit/6002/multidex-by-using-multidexapplication-directly#t=20160807053003773542
When these configuration settings are added to an app, the Android build tools construct a primary dex (classes.dex) and supporting (classes2.dex, classes3.dex) as needed.
The build system will then package them into an APK file for distribution.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents