When trying to create an android apk file using ionic and gradle, i get an error
FAILURE: Build failed with an exception.
* What went wrong:
Unable to star
I had the same problem. I read your answer and thought, "That seems like way too much work." So, I kept digging.
I found this answer: https://stackoverflow.com/a/9813900/3771976
It says to set an environment variable:
GRADLE_OPTS=-Xmx512m
I had to increase the memory limit further to 1024, but it solved the problem.
Oracle Documentation for JVM Option