Android Studio中的Aspose.Cells:OutOfMemoryError

时间:2014-06-19 09:58:29

标签: android-studio aspose-cells

我在Android Studio项目中引用了Aspose.Cells jar文件,但在编译时遇到以下错误:

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

com.android.ide.common.internal.LoggedErrorException:无法运行命令:       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   错误代码:       3   输出:       意外的顶级错误:       java.lang.OutOfMemoryError:超出了GC开销限制           在com.android.dx.util.IntList.growIfNeeded(IntList.java:274)           在com.android.dx.util.IntList.add(IntList.java:217)           在com.android.dx.util.LabeledList.addLabelIndex(LabeledList.java:96)           在com.android.dx.util.LabeledList.set(LabeledList.java:184)           在com.android.dx.rop.code.BasicBlockList.set(BasicBlockList.java:77)           在com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:259)           在com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:123)           在com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:69)           在com.android.dx.ssa.Optimizer.optimizeMinimizeRegisters(Optimizer.java:146)           在com.android.dx.ssa.Optimizer.optimize(Optimizer.java:106)           在com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)           在com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:299)           在com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)           在com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)           在com.android.dx.command.dexer.Main.processClass(Main.java:682)           在com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)           在com.android.dx.command.dexer.Main.access $ 600(Main.java:78)           在com.android.dx.command.dexer.Main $ 1.processFileBytes(Main.java:572)           在com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)           在com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)           在com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)           在com.android.dx.command.dexer.Main.processOne(Main.java:596)           在com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)           在com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)           在com.android.dx.command.dexer.Main.run(Main.java:230)           在com.android.dx.command.dexer.Main.main(Main.java:199)           在com.android.dx.command.Main.main(Main.java:103)

2 个答案:

答案 0 :(得分:0)

Android的Aspose.Cells已成功通过ADT Bundle进行测试,因为Android Studio尚未完全稳定。

如果您在Android Studio上遇到OutOfMemoryError,请尝试增加分配的内存。检查Android Studio - How to increase Allocated Heap Size上的答案。

PS:我是Aspose的开发人员。

答案 1 :(得分:0)

dexOptions {
   incremental true

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

   javaMaxHeapSize "1024M"

   //javaMaxHeapSize "2048M"
}