Reputation: 891
I created an app with Ionic but when trying to build it I get this error:
FAILURE: Build failed with an exception.
Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap
Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap
What is it that I am doing wrong? How can I change those settings?
Upvotes: 1
Views: 5443
Reputation: 31
Just for anyone who has been having this same problem. I encountered it too and solved it the following way.
I changed the argument
'org.gradle.jvmargs': '-Xmx2048m',
to:
'org.gradle.jvmargs': '-Xmx1024m',
in the constructor of GradlePropertiesParser class. This can be find on line 37 of GradlePropertiesParser.js at:
platforms/android/cordova/lib/config
The result was successful for me.
Upvotes: 3