1

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

Joel
  • 309
  • 1
  • 2
  • 13
  • It's not a bug in Android Studio. You're using multidex configuration and the error says that your main-dex exceeded the functions count limit. – Alex Lipov Sep 25 '15 at 11:01

0 Answers0