0

I'm new to Cordova, I have created project, however when I try to build the project using the command "cordova build android" I get the below error message:

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/
2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

I am using Ionic framework, please help to get this done!

Thank You!

Sahil Buddhadev
  • 63
  • 2
  • 13
  • please refer to this http://stackoverflow.com/questions/9303889/error-occurred-during-initialization-of-vm-could-not-reserve-enough-space-for – Nadeem Khoury Nov 17 '16 at 10:20

1 Answers1

0

As i can see it is a memory problem on heap. You must configure the jvmargs.

The solution is to create the file gradle.properties in the user home (C:\Users\username.gradle or ~.gradle) and set the jvm options:

org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m

Note that according to your OS, it is possible the 1024m to throw erros so try and with 512m.

For the story, he flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM).

e7lT2P
  • 1,635
  • 5
  • 31
  • 57