When I try to compile an android project in Intellij IDEA I get
Unable to execute DX
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)
Searching I have found these solutions
A) add
android {
dexOptions {
jumboMode = true
}
}
in buid.gradle
or
B) add
dex.force.jumbo=true
in project.proprerties
for non-gradle projects
I haven't any build.gradle so I have tried the second solution adding the line at the end of project.properties
in this way
# Project target.
target=Google Inc.:Google APIs:23
dex.force.jumbo=true
Unfortunately this solution doesn't work and get the same error. My classes aren't too much big and want to avoid Multidex... with my surprise this error happens only after the update of the Android support v4 library and Google Play Services to latest release.
Any suggestion?