2012-09-21 111 views
0

我構建了android開發環境並從android開發網站下載了android4.1-cts源代碼。但構建源代碼時出現如下錯誤:在VMware12.04上構建Android源代碼時出現錯誤

host Java:ddmlib-tests (out/host/common/obj/JAVA_LIBRARIES/ddmlib- tests_intermediates/classes) 
host Java: swtmenubar (out/host/common/obj/JAVA_LIBRARIES/swtmenubar_intermediates/classes) 
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space 
at java.util.Vector.<init>(Vector.java:111) 
at java.util.Vector.<init>(Vector.java:124) 
at org.antlr.analysis.DFA.createTransitionTableEntryForState(DFA.java:551) 
at org.antlr.analysis.DFA.createStateTables(DFA.java:440) 
at org.antlr.codegen.CodeGenerator.genLookaheadDecision(CodeGenerator.java:645) 
at org.antlr.grammar.v3.CodeGenTreeWalker.block(CodeGenTreeWalker.java:2876) 
at org.antlr.grammar.v3.CodeGenTreeWalker.rule(CodeGenTreeWalker.java:2382) 
at org.antlr.grammar.v3.CodeGenTreeWalker.rules(CodeGenTreeWalker.java:1537) 
at org.antlr.grammar.v3.CodeGenTreeWalker.grammarSpec(CodeGenTreeWalker.java:1441) 
at org.antlr.grammar.v3.CodeGenTreeWalker.grammar_(CodeGenTreeWalker.java:461) 
at org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:421) 
at org.antlr.Tool.generateRecognizer(Tool.java:655) 
at org.antlr.Tool.process(Tool.java:468) 
at org.antlr.Tool.main(Tool.java:93) 
make: *** [out/host/common/obj/JAVA_LIBRARIES/smali_intermediates/smaliLexer.java] Error 1 
make: *** Waiting for unfinished jobs.... 

我發現了一些解決方案,例如更改java -Xms16m -Xmx1024m,但它也不起作用。 我能做什麼? 謝謝!

+0

嘗試使用此http://www.google.com/search?#q=JAVA_LIBRARIES%2Fsmali_intermediates%2FsmaliLexer.java]+Error+1也不要忘記避開OpenJDK並使用Java 6 JDK – Ken

回答

0

我已經找到了解決辦法:找到外部/ smali/smali/android.mk 更改添加-Xm1024m爲$(GEN):PRIVATE_CUSTOM_TOOL = Java的罐子$(ANTLR_JAR) - fo $(dir $ @)$ <。

0

您有內存問題。儘量使-j1打造代碼

+0

I哈瓦試試你的說法。錯誤仍然存​​在。 – Hilda

+0

試試這個..因爲我沒有4.1源碼,我無法確定.. [link](https://groups.google.com/forum/?fromgroups#!topic/android-building/Or1C6bpq8)看到最後的解決方案..保持我張貼 – anz

相關問題