Android8.0编译时 Out of memory error 错误

编译时报错:
[ 71% 80697/113026] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
/bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp

Out of memory error (version 1.3-rc7 ‘Douarn’ (445000 d7be3910514558d6715ce455ce0861ae2f56925a by [email protected])).

GC overhead limit exceeded.
Try increasing heap size with java option ‘-Xmx’.
Warning: This may have produced partial or corrupted output.

原因:内存不够

解决方法:

办法:添加限制,输入如下命令:
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server

你可能感兴趣的:(一切都是最好的安排)