Compile generates "Process is taking longer than expected"

Doug Harris

Member
Licensed User
I am porting a rather large c++ application to B4A. I have been able to run interim builds of the B4A app along the way, but the last week or so has been spent moving an extensive amount of code over. When I try to compile the app for DEBUG and RUN (using the F5 key), I get an error "Process is taking longer than expected" at the "Convert byte code - optimized dex" step. When I tell the compiler to continue to wait, an error window appears with a series of messages

bad class file magic (cafebabe) or version (0033.0000)
...while parsing POSNetwork/POSNetwork.class

The operation Compile (without signing) runs successfully as does a compile for Release (obfuscated).

Any assistance on this problem will be greatly appreciated.
 

Doug Harris

Member
Licensed User
Thanks Erel. I neglected to say that I had already tried changing the timeout from 30 to 60. With this change, I no longet get the "taking too long" message. However, I still get the "bad class magic" error. I have included the entire error message, as there is a reference to "Out of memory" (highlighted in red) that may shed some light on the problem. I have a single classs module that has nearly 4,000 lines of code. Is there a limit to then number of lines a module can contain?

Also, please keep in mind that the application will compile successfully if I just compile (Alt-2). The problem only appears when I Compile & Run (F5).

-------------------------------------------------------------------
Compiling code. 2.59
Compiling layouts code. 0.00
Generating R file. 4.23
Compiling generated Java code. 10.95
Convert byte code - optimized dex. Error
trouble processing:
bad class file magic (cafebabe) or version (0033.0000)
...while parsing POSNetwork/POSNetwork.class
...while processing POSNetwork/POSNetwork.class
trouble processing:
bad class file magic (cafebabe) or version (0033.0000)
...while parsing POSNetwork/POSWatchdog$TNetworkPacketHeader.class
...while processing POSNetwork/POSWatchdog$TNetworkPacketHeader.class
trouble processing:
bad class file magic (cafebabe) or version (0033.0000)
...while parsing POSNetwork/POSWatchdog$TVersionInfo.class
...while processing POSNetwork/POSWatchdog$TVersionInfo.class
trouble processing:
bad class file magic (cafebabe) or version (0033.0000)
...while parsing POSNetwork/POSWatchdog$TZCounterRecord.class
...while processing POSNetwork/POSWatchdog$TZCounterRecord.class
trouble processing:
bad class file magic (cafebabe) or version (0033.0000)
...while parsing POSNetwork/POSWatchdog.class
...while processing POSNetwork/POSWatchdog.class
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2343)
at java.util.BitSet.ensureCapacity(BitSet.java:329)
at java.util.BitSet.expandTo(BitSet.java:344)
at java.util.BitSet.set(BitSet.java:439)
at com.android.dx.ssa.SsaBasicBlock.insertNewSuccessor(SsaBasicBlock.java:478)
at com.android.dx.ssa.SsaConverter.edgeSplitMoveExceptionsAndResults(SsaConverter.java:210)
at com.android.dx.ssa.SsaConverter.edgeSplit(SsaConverter.java:136)
at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:48)
at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:99)
at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:73)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:273)
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:483)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
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:418)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)
Standard dexer.
 
Upvote 0

Doug Harris

Member
Licensed User
Problem resolved!

I found an earlier post that discussed increasing the MaxRamForDex setting. This has solved my problem. Thanks Erel for your assistance.
 
Upvote 0
Top