I am trying to deploy my freshly created Ionic 3 app (I am using 64-bit Windows 10) on my mobile but it is throwing error after running ionic cordova run android --device
:
> cordova build android
ANDROID_HOME=D:\android-sdk\tools\bin
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_161
Subproject Path: CordovaLib
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Error: cmd: Command failed with exit code 1
[ERROR] An error occurred while running cordova build android (exit code 1).
I have installed Android studio. I have added a system variable _ JAVA_OPTIONS with value -Xmx512M I have also added a system variable GRADLE_OPTS with value -Xmx2048M
Otherwise I have:
ANDROID_HOME=D:\android-sdk\tools\bin
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_161
Why is this error still occurring?