2012-07-06 127 views
1

我嘗試添加以下jar文件時,Java堆空間錯誤: 蒂卡-APP-1.1編譯Android項目

這裏是控制檯輸出:

[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 

(這是一個非常小的它的一部分,它每次重複使用不同類...

我可以爲了解決這個問題,怎麼辦?

回答

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的最新版本並查看。

+0

問題是,它肯定是最新版本:http://tika.apache.org/download.html – 2012-07-06 19:20:08

+0

然後你可以降級jar版本並檢查。編譯級別和jar編譯級別之間存在一些不兼容性。 – kosa 2012-07-06 19:21:38

+0

當你說降級時,你的意思是下載最舊版本的jar? – 2012-07-06 19:22:50

0

Android dx命令需要較大的堆棧空間。給'java'命令提供'-Xss256m'選項。如果您使用的是Eclipse,請打開eclipse.ini並添加'-Xss256m'。

+0

不是這樣,有時會出現此錯誤,有時會出現dx 1錯誤,這肯定是一個問題罐子本身 – 2012-07-06 19:30:56

+0

我也試過這樣做,但沒有幫助 – 2012-07-06 20:02:53