I am running Ubuntu 14.04.5 LTS to compile Android 7.1.1 on a VM inside windows with 11GB of RAM assigned. Android keeps failing to build due to "out of memory errors" as seen below.
Out of memory error (version 1.2-rc4 'Carnac'(298900f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
[0;31m#### make failed to build some targets (03:04:37 (hh:mm:ss)) ####
I am trying to follow this guide: Android source code compile error: "Try increasing heap size with java option '-Xmx<size>'" to increase the heap size.
As the top answer suggests the jack server needs to be stopped and started using jack-admin. When I use this command I am given the error message: "jack-admin: command cannot be found" how do I add jack-admin to the path?
The jack server can be found in the Android source code in the location of prebuilts/sdk/tools and can be run from there.
prebuilts/sdk/tools$ ./jack-admin stop-server
prebuilts/sdk/tools$ ./jack-admin start-server
Or this folder can then be added to the PATH by running:
export PATH=$PATH:~/myandroid/prebuilts/sdk/tools