I have a large app with 20 activities, several custom classes, and a few services. It compiles fine with the standard compile, but when I try to do a debug compile, I get the following:
B4X:
Parsing code. 0.83
Compiling code. 1.31
Compiling layouts code. 0.11
Generating R file. 0.16
Compiling generated Java code. 15.69
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.android.dx.util.FixedSizeList.<init>(FixedSizeList.java:38)
at com.android.dx.rop.code.RegisterSpecList.<init>(RegisterSpecList.java:103)
at com.android.dx.cf.code.RopperMachine.getSources(RopperMachine.java:669)
at com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:289)
at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:692)
at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:763)
at com.android.dx.cf.code.Simulator.simulate(Simulator.java:95)
at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:684)
at com.android.dx.cf.code.Ropper.doit(Ropper.java:639)
at com.android.dx.cf.code.Ropper.convert(Ropper.java:252)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:256)
at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:134)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87)
at com.android.dx.command.dexer.Main.processClass(Main.java:487)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:135)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:422)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
at com.android.dx.command.dexer.Main.run(Main.java:209)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)
Optimized dexer failed. Switching to Standard dexer.