编译android项目时Java堆空间错误

时间:2012-07-06 19:14:13

标签: java android apache-tika

我正在尝试添加以下jar文件: 蒂卡-APP-1.1

以下是控制台输出:

[2012-07-06 22:05:03 - iCards] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.xml.DOMConfigurator$3) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2012-07-06 22:05:03 - iCards] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.xml.DOMConfigurator$4) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2012-07-06 22:05:03 - iCards] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.log4j.xml.DOMConfigurator$5) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2012-07-06 22:09:03 - Dex Loader] Unable to execute dex: Java heap space
[2012-07-06 22:09:03 - iCards] Conversion to Dalvik format failed: Unable to execute dex: Java heap space

(这只是其中的一小部分,每次重复一次......

我可以做些什么来解决这个问题?

2 个答案:

答案 0 :(得分:3)

This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options

您的编译器版本似乎不兼容。这意味着jar是旧版本。尝试获取该jar的最新版本并查看。

答案 1 :(得分:0)

Android dx命令需要大量堆栈空间。为'java'命令提供'-Xss256m'选项。如果您使用的是Eclipse,请打开eclipse.ini并添加'-Xss256m'。