0

自己搭建了android开发环境,从android开发网站下载了android4.1-cts源码,但是在搭建源码的时候报错如下:

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,但是也不管用。我能做些什么?谢谢!

4

2 回答 2

0

你有记忆问题。尝试 make -j1 构建代码

于 2012-09-21T11:14:52.410 回答
0

我找到了解决方案:找到 external/smali/smali/android.mk 更改添加 -Xm1024m 到 $(GEN): PRIVATE_CUSTOM_TOOL = java -jar $(ANTLR_JAR) -fo $(dir $@) $<。

于 2012-09-26T03:18:41.053 回答