解决Android 源码编译错误的问题
如下所示:
BuildingwithJack:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED:/bin/bashout/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Outofmemoryerror(version1.2-a26'Carnac'(291201fcd657165d2fd6dcf1bf4c3002c9c8f75383e815byandroid-jack-team@google.com)).
GCoverheadlimitexceeded.
Tryincreasingheapsizewithjavaoption'-Xmx'.
Warning:Thismayhaveproducedpartialorcorruptedoutput.
ninja:buildstopped:subcommandfailed.
在文件/prebuilts/sdk/tools/jack-admin中修正-Xmx参数。
1、修改变量JACK_SERVER_VM_ARGUMENTS,添加参数-Xmx2048M
JACK_SERVER_VM_ARGUMENTS="${JACK_SERVER_VM_ARGUMENTS:=-Dfile.encoding=UTF-8-XX:+TieredCompilation-mx2048M}"
2、进一步修正重启参数(该步骤可以省略)
找到jack-admin中的start-server语句,直接在里面增加:
start-server) isServerRunning RUNNING=$? if["$RUNNING"=0];then echo"Serverisalreadyrunning" else echo"beforetostart-server,JACK_SERVER_VM_ARGUMENTS="$JACK_SERVER_VM_ARGUMENTS JACK_SERVER_COMMAND="java-Djava.io.tmpdir=$TMPDIR$JACK_SERVER_VM_ARGUMENTS-Xmx2048M-cp$LAUNCHER_JAR$LAUNCHER_NAME" echo"LaunchingJackserver"$JACK_SERVER_COMMAND (
补充知识:编译android7.0出现Tryincreasingheapsizewithjavaoption'-Xmx'错误解决方案
出现这个错误是由于电脑内存不足,在命令行分别执行以下三条语句,然后继续编译
exportJACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8-XX:+TieredCompilation-Xmx4g"
./prebuilts/sdk/tools/jack-adminkill-server
./prebuilts/sdk/tools/jack-adminstart-server
以上这篇解决Android源码编译错误的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。