1

I am facing some issues while run my ionic project to the device. Please Help me resolve the issue.

C:\MobileProjects\Angular\sample-app>ionic cordova run android ...... [13:44:18] lint started ... [13:44:18] build dev finished in 46.35 s

cordova run android [13:44:50] lint finished in 32.50 s ANDROID_HOME=C:\Users\Technotricks\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131\jre`` Subproject Path: CordovaLib Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for de tails

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/ 3.3/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. 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/ 3.3/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.

[ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova run android (exit code 1).

D:\MobileProjects\Angular\sample-app>

Technotricks
  • 31
  • 1
  • 4
  • so did you try to run with `--stacktrace` to see where the failure occurs? somewhere you're trying to (directly or indirectly) create a huge object of 2GB – Ovidiu Dolha May 23 '17 at 06:11
  • Look here [answer on stackoverflow](https://stackoverflow.com/questions/41216921/cordova-could-not-reserve-enough-space-for-2097152kb-object-heap) – Paulius Nyoumi Jan 18 '18 at 10:50
  • look the [answer on stackoverflow](https://stackoverflow.com/questions/41216921/cordova-could-not-reserve-enough-space-for-2097152kb-object-heap) – Paulius Nyoumi Jan 18 '18 at 10:51
  • This is something about your environment variables. Try changing your `JAVA_HOME` variable to resolve it. – Alex Villanova Oct 15 '17 at 18:42

1 Answers1

0

Try again after increasing your Java VM(?) memory size.

Here is how to fix it on a Windows platform:

Go to Start -> Control Panel -> System -> Advanced(tab) -> Environment Variables -> System Variables -> New: Variable name: _JAVA_OPTIONS Variable value: -Xmx512M

Don't ignore the score and underscore characters.

Look here

Paulius Nyoumi
  • 191
  • 1
  • 12