Hi, in a big Gradle-based Android project I'm using multiple dex files to overcome the 64k method limit issue. My question is, what's the best way to (programmatically) determine the list of classes that should go into the file passed via the "--main-dex-list" argument to dx? Obviously, the classes for the multi-dex capable classloader in use have to go there. Likewise, the class file for the application class that is specified as part of the manifest which initializes the class loader.
But that alone does not seem to be enough. In my tests I also had to add all class files of all dependent classes of my application class to the main dex file. Interestingly, this only seems to be enough when using the ART runtime. When using the Dalvik runtime on the same device, I had to add various other classes to be included in the main dex file, and the only way I could determine these additional classes was to inspect the log for messages containing "java.lang.NoClassDefFoundError", "Failed resolving" or "Unable to resolve superclass of". So my question is actually two-fold: - How can I determine the full list of classes required in the main dex file reliable and programmatically? - Why is there a difference between the ART and Dalvik runtime in terms of required classes? Thanks, Sebastian -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
