Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic class loading with IntelliJ - 64K method dex issue

I am working on a project that is quickly approaching the 64K method limit for dex files. This Android Developer blog post (from July 2011) explains how to get dynamic class loading working with a command-line build driven by Ant, but does not explore how to get it working from within IDEs (besides saying it won't work within Eclipse).

I looked around and couldn't find anything on getting this system to work from within IntelliJ. Does IntelliJ supports building apps with multiple dex files? If so, how does one set it up?

like image 958
Mark Avatar asked Jan 15 '14 19:01

Mark


1 Answers

Try using ProGuard to strip out unused classes and methods from your project and you should (hopefully) find you don't need multiple dex files.

That said if you do: IntelliJ and Eclipse are just IDEs -- they don't directly build your code -- so you will need to identify how your project is being built -- most likely Ant or Gradle.

If your project is a Gradle project then there will be a build.gradle file in the project root -- if this is the case then you will need to look how to accomplish the same with the Android Gradle plugin, a good place to start would be http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Manipulating-tasks.

like image 118
Joseph Earl Avatar answered Nov 03 '22 09:11

Joseph Earl