title: ERROR: An error occurred while running subprocess cordova
body: <p>I build an app on Ionic framework, it works on the browser but when I try to compile it on the emulator I have got this error:</p>
  
  <p>Checking Java JDK and Android SDK versions
  ANDROID_SDK_ROOT=undefined (recommended setting)
  ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk (DEPRECATED)
  Starting a Gradle Daemon (subsequent builds will be faster)</p>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li>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 Manual chapter on the daemon at <a href="https://docs.gradle.org/5.3.1/userguide/gradle_daemon.html" rel="nofollow noreferrer">https://docs.gradle.org/5.3.1/userguide/gradle_daemon.html</a>
  Process command line: C:\Program Files (x86)\Java\jdk1.8.0_201\bin\java.exe -Xmx2048m -Dfile.encoding=windows-1252 -Duser.country=SA -Duser.language=ar -Duser.variant -cp C:\Gradle\gradle-5.3.1\lib\gradle-launcher-5.3.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.3.1
  
  <h2>Please read the following process output to find out more:</h2></li>
  </ul>
  
  <p>Error occurred during initialization of VM
  Could not reserve enough space for 2097152KB object heap</p>
  
  <ul>
  <li><p>Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.</p></li>
  <li><p>Get more help at <a href="https://help.gradle.org" rel="nofollow noreferrer">https://help.gradle.org</a>
  C:\Gradle\gradle-5.3.1\bin\gradle: Command failed with exit code 1
  [ERROR] An error occurred while running subprocess cordova.</p>
  
  <pre><code>cordova run android exited with exit code 1.
  
  Re-running this command with the --verbose flag may provide more information.
  </code></pre></li>
  </ul>