I dont Know how to solve Multidex issue in Android. My app has lots of SDKs integration, so App is crossing 65k Over Method limit. I went through lots of tutorials and blogs. I got so many solutions. One of them is below mentioned as part of my gradle. Please someone provide a good and working solution.
android {
minSdkVersion 16
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "your.package.name"
.......... }
buildTypes {
release {
.............................
}
}
// Inside android part of build.gradle
dexOptions {
preDexLibraries = false
}
}
.............
............
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
..................
// Inside dependencies part of build.gradle
compile 'com.android.support:multidex:1.0.1'
..............
}
// Outside android part of build.gradle
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = []
}
dx.additionalParameters += '--multi-dex'
}
........
.......
}