Can you try to delete all the build folders manually and build again, making sure the dexOptions.jumboMode is set to true in the project?
There's an issue where the root project's build is not deleted in the clean task and this contains some information about the pre-dexed libraries. This should ensure that all libraries will get preDexed again with the jumbo options and this should result in a correct merge. Note that building from Studio or from the command line should have no impact on the result, since Studio just calls out to Gradle to build. On Thu, Sep 18, 2014 at 2:13 AM, Jerry Tian <[email protected]> wrote: > 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. > -- Xavier Ducrohet Android SDK Tech Lead Google Inc. http://developer.android.com | http://tools.android.com Please do not send me questions directly. Thanks! -- 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.
