0

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 :

Ionic:

   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:

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

Utility:

   cordova-res : not installed
   native-run  : 0.3.0

System:

   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 https://docs.gradle.org/6.0.1/userguide/gradle_daemon.html
Process command line: C:\Program Files (x86)\Java\jdk1.8.0_191\bin\java.exe -Xmx2048m -Dfile.encoding=windows-1252 -Duser.country=FR -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 https://help.gradle.org
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

bithub
  • 77
  • 10

2 Answers2

0

According to sky007

this https://forum.ionicframework.com/t/ionic-cordova-build-android-fails/102638/2

line:args.push(’-Dorg.gradle.jvmargs=-Xmx1024m’); 

in Your Project file where

platforms\android\cordova\lib\builders\GradleBuilder.js

also in this thread (Ionic Framework forum)

Sujan12

Community Moderator (not Ionic Team)

https://forum.ionicframework.com/t/error-when-i-build-my-apk-file/138153/5

try to increase RAM

if none of helps check out this

Cordova Could not reserve enough space for 2097152KB object heap

Chanaka Weerasinghe
  • 5,404
  • 2
  • 26
  • 39
0

i seloved by Uninstall jdk 8.191 and then install jdk 8.231

bithub
  • 77
  • 10