FAILURE: Build failed with an exception. 'Error occurred during initialization of VM'

Iโ€™m very new to the Ionic framework

>npm install -g cordova
>npm install -g ionic
>ionic start test blank
>cd test
>ionic platform add android

and this is my ionic info :slight_smile:


   Ionic CLI                     : 5.4.8 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.11.5
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.1.1


   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : not available


   cordova-res : not installed
   native-run  : 0.3.0


   Android SDK Tools : 26.1.1 (C:\Users\user\AppData\Local\Android\Sdk)
   NodeJS            : v13.1.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.12.1
   OS                : Windows 7

When I use โ€™ >ionic build android โ€™
and boom i get an error.

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\user\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk (DEPRECATED)
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

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 Manual chapter on the daemon at
Process command line: C:\Program Files (x86)\Java\jdk1.8.0_191\bin\java.exe -Xmx2048m -Dfile.encoding=windows-1252 -Duser.language=fr -Duser.variant -cp C:\Program Files\gradle-6.0.1\lib\gradle-launcher-6.0.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.0.1
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. Run with --scan to get full insights.

* Get more help at
C:\Program Files\gradle-6.0.1\bin\gradle: Command failed with exit code 1
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --release exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

please i was spended a lot of time to trying to solve the problem but i canโ€™t solved
if any one know to solve the problem please tell me

having the same issue could you please reply if you got the solution.