Android source code compile error: “Try increasing heap size with java option '-Xmx'”

前端 未结 6 1318
北恋
北恋 2020-12-04 18:40

Error happens when I try to compile Android source code(Sourcecode-version: 6.0.1; RAM: 6G; host system: ubuntu 14.04),log is below:

including ./system/netd/         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-04 18:50

    I had the same problem. So I've tried to set JACK_SERVER_VM_ARGUMENTS to include -Xmx=4g, but when building again the log output showed that this was not included in the startup. Dunno why, seems like the env vars do not get passed to the build script correctly.

    Solution

    Before starting a clean android build set the JACK_SERVER_VM_ARGUMENTS to include -Xmx=4g, then stop and start the jack server manually. Given you're in the main source tree of AOSP run the following:

    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
    

    for cm you can use

    export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
    jack-admin kill-server && jack-admin start-server
    

    This resolved the issue for me.

提交回复
热议问题