1
votes

I have referenced Aspose.Cells jar file in my Android Studio project, but I get the following error when I compile:

Error:Execution failed for task ':kpi:preDexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\jcmag_000\AppData\Local\Android\android-studio\sdk\build-tools\19.1.0\dx.bat --dex --output D:\Android\MockupBuilder\kpi\build\intermediates\pre-dexed\debug\aspose-cells-8.1.0-ee32824075207ab5167ea34e50ad48740612abbf.jar D:\Android\MockupBuilder\kpi\libs\aspose-cells-8.1.0.jar Error Code: 3 Output: UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: GC overhead limit exceeded at com.android.dx.util.IntList.growIfNeeded(IntList.java:274) at com.android.dx.util.IntList.add(IntList.java:217) at com.android.dx.util.LabeledList.addLabelIndex(LabeledList.java:96) at com.android.dx.util.LabeledList.set(LabeledList.java:184) at com.android.dx.rop.code.BasicBlockList.set(BasicBlockList.java:77) at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:259) at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:123) at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:69) at com.android.dx.ssa.Optimizer.optimizeMinimizeRegisters(Optimizer.java:146) at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:106) at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72) at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:299) at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139) at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94) at com.android.dx.command.dexer.Main.processClass(Main.java:682) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634) at com.android.dx.command.dexer.Main.access$600(Main.java:78) at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.java:596) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264) 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)

2

2 Answers

0
votes

Aspose.Cells for Android has been successfully tested with ADT Bundle as Android Studio is not fully stable yet.

If you are experiencing OutOfMemoryError on Android Studio try increasing the allocated memory. Check answers on Android Studio - How to increase Allocated Heap Size.

PS: I am a developer at Aspose.

0
votes
dexOptions {
   incremental true

   //javaMaxHeapSize=1024M for 32bit Java,2048M for 64bit Java

   javaMaxHeapSize "1024M"

   //javaMaxHeapSize "2048M"
}