当出现heap不足时有两种解决办法:
1,打开prebuilts/sdk/tools/jack-admin
对JACK_SERVER_COMMAND增加-Xmx4096m选项
2,导出环境变量
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
两种方式任选其一都可以,然后执行jack重启命令:
out/host/linux-x86/bin/jack-admin kill-server
out/host/linux-x86/bin/jack-admin start-server