I tried to build the latest version for the android demo but the command mvn clean install package
failed (inside android/app) with:
[INFO] --- android-maven-plugin:4.0.0-rc.2:dex (default-dex) @ graphhopper-android ---
[INFO] Convert classes to Dex : /home/peterk/Documents/quell/graphhopper/android/app/target/classes.dex
[INFO] Java HotSpot(TM) Server VM warning: INFO: os::commit_memory(0x75500000, 119275520, 0) failed; error='Cannot allocate memory' (errno=12)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:03 min
[INFO] Finished at: 2016-01-25T15:46:30+01:00
[INFO] Final Memory: 18M/275M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:4.0.0-rc.2:dex (default-dex)
...
using 1.7.0_91
My machine is rather low equipped (2-3gb RAM) and I had the IDE still open. Closing the IDE solved the problem. I think the reason behind is that I have too few memory and dexing requires too much and the subprocess then requires the same amount again. See this post here: http://stackoverflow.com/a/2761855/194609
Can we avoid this or reduce memory usage for building the Android demo via maven?