2012年12月8日 星期六

[AOSP] make: *** [out/host/common/obj/JAVA_LIBRARIES/smali_intermediates/smaliLexer.java]

Problem:
When I built Android Framandroid-4.1.2_r1 on Ubuntu, I got the error message below.

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....



Solution:
Open file in  
external/smali/smali/Android.mk
Find the line 
$(GEN): PRIVATE_CUSTOM_TOOL = java -jar $(ANTLR_JAR) -fo $(dir $@) $<
Change it to 
$(GEN): PRIVATE_CUSTOM_TOOL = java -Xmx512m -jar $(ANTLR_JAR) -fo $(dir $@) $<


Reference:
https://groups.google.com/forum/#!msg/android-building/Or1C6bpq8GQ/xAEMEEM0gKAJ


**********************************************************************
Related issues:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

at java.lang.String.toCharArray(String.java:2726)
at java.util.zip.ZipOutputStream.getUTF8Bytes(ZipOutputStream.java:483)
at java.util.zip.ZipOutputStream.writeLOC(ZipOutputStream.java:348)
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:179)
at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
at com.android.tools.layoutlib.create.AsmGenerator.createJar(AsmGenerator.java:241)
at com.android.tools.layoutlib.create.AsmGenerator.generate(AsmGenerator.java:225)
at com.android.tools.layoutlib.create.Main.main(Main.java:98)
make: *** [out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar] Error 1
make: *** Deleting file `out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar'

Edit the file
frameworks/base/tools/layoutlib/Android.mk

Reference:
https://groups.google.com/forum/?fromgroups=#!topic/android-building/D3QmmvsMRME


沒有留言:

張貼留言