While build the android with android studio, I got this error below:
com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:494)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:244)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
It's ok when using the jdk1.7 version. It only happened with the java 1.8. Is a bug in the android studio.
Here is the build.gradle:
if (dx.additionalParameters == null) {
dx.additionalParameters = []
}
dx.additionalParameters += '--set-max-idx-number=56000'
dx.additionalParameters += '--num-threads=4'
dx.additionalParameters += '--minimal-main-dex'
How can i do with jdk1.8 version?
【found the solution】:https://github.com/alipov/main-dex-too-many-methods