DexException: Too many classes in --main-dex-list, main dex capacity exceeded

767 views
Skip to first unread message

Brian Parma

unread,
May 26, 2015, 3:10:53 PM5/26/15
to mac...@googlegroups.com
I recently discovered the 'Scala on Android' option for android apps and have been working on a test app in scala.  I am use to using AndroidStudio with Gradle, so I setup the latest AndroidStudio to use the gradle-android-scala-plugin and scala 2.11.6 according to: https://github.com/saturday06/gradle-android-scala-plugin

This worked fine, but I would like to use Macroid, so I added the dependency in gradle:

compile 'org.macroid:macroid_2.11:2.0.0-M4'

This compiles fine in AndroidStudio but when I tried to run it (assembleDebug) I was getting the DexIndexException for too many methods.  I tried enabling MultiDex (according to their wiki and android docs), but this just gave me a new exception:

DexException: Too many classes in --main-dex-list, main dex capacity exceeded

my deps are:
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'org.scala-lang:scala-library:2.11.6'
compile 'org.macroid:macroid_2.11:2.0.0-M4'
compile "com.android.support:multidex:1.0.1"

I can't find any information on this exception. Has anyone seen it? Has anyone got a configuration of Macroid + AndroidStudio + Gradle working?

Any help would be appreciated!
B




Nick Stanchenko

unread,
May 27, 2015, 5:24:54 AM5/27/15
to mac...@googlegroups.com, exec...@gmail.com
Hi Brian,

I’m not very familiar with the Gradle toolchain, so I’ve created issue there and linked to this thread: https://github.com/saturday06/gradle-android-scala-plugin/issues/60.

Hope that helps,
Nick
Reply all
Reply to author
Forward
0 new messages