We have a large project, and need to enable jumbo mode with dex following the instructions here:
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-dex-options But still we got exceptions during building(pasted at the end of this post). Meanwhile, we found it the Android Studio can still generate debug binaries within IDE, which make us think the jumbo mode is actually working when running in Android Studio. We tried to upgrade the build tools to the latest version, build specific flavor of the project(this is a multi flavor project), none of this work, but when we disabled preDexLibraries(which is turned on by default, at least when invoked from command line), the dex exception is gone. For now, we can stick to this work around, but since the preDexLibraries can save us a lot of build time, we would love to see if it can be fixed. The dex exception during Gradle build: > > FAILURE: Build failed with an exception. > > > > > * What went wrong: > > Execution failed for task ':app-firephone-android-tube:dexFireTubeRelease'. > > > com.android.ide.common.internal.LoggedErrorException: Failed to run > command: > > /Users/jerry/adt-bundle-mac-x86_64-20130917/sdk/build-tools/19.1.0/dx > --dex --force-jumbo --num-threads=4 ...... a lot of jar stuff > > Error Code: > > 2 > > Output: > > > > UNEXPECTED TOP-LEVEL EXCEPTION: > > com.android.dex.DexException: Cannot merge new index 65770 into a > non-jumbo instruction! > > at > com.android.dx.merge.InstructionTransformer.jumboCheck(InstructionTransformer.java:108) > > at > com.android.dx.merge.InstructionTransformer.access$800(InstructionTransformer.java:25) > > at > com.android.dx.merge.InstructionTransformer$StringVisitor.visit(InstructionTransformer.java:71) > > at com.android.dx.io.CodeReader.callVisit(CodeReader.java:114) > > at com.android.dx.io.CodeReader.visitAll(CodeReader.java:89) > > at > com.android.dx.merge.InstructionTransformer.transform(InstructionTransformer.java:48) > > at com.android.dx.merge.DexMerger.transformCode(DexMerger.java:840) > > at com.android.dx.merge.DexMerger.transformMethods(DexMerger.java:811) > > at com.android.dx.merge.DexMerger.transformClassData(DexMerger.java:783) > > at com.android.dx.merge.DexMerger.transformClassDef(DexMerger.java:680) > > at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:540) > > at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) > > at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) > > at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) > > at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) > > at com.android.dx.command.dexer.Main.run(Main.java:230) > > at com.android.dx.command.dexer.Main.main(Main.java:199) > > at com.android.dx.command.Main.main(Main.java:103) My system setup is: > > jerry$ ./gradlew --version > ------------------------------------------------------------ > Gradle 1.12 > ------------------------------------------------------------ > > > > Build time: 2014-04-29 09:24:31 UTC > Build number: none > Revision: a831fa866d46cbee94e61a09af15f9dd95987421 > > > > Groovy: 1.8.6 > Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 > Ivy: 2.2.0 > JVM: 1.7.0_45 (Oracle Corporation 24.45-b08) > OS: Mac OS X 10.10 x86_64 > > > -- 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.
