Gradle error download when running ionic build android

2

I have an error trying to compile an apk of a new project, since apparently the link that should add the daemons and everything about the gradle seems to be wrong .

Next I put the error.

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\sqliteTest\hooks\after_prepare0_add_platform_class.js C:\Users\pedromiguel\aplicacionesIonic\sqliteTest


add to body class: platform-android

ANDROID_HOME=C:\Users\pedromiguel\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

Subproject Path: CordovaLib



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 http://gradle.org/docs/2.2.1/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 http://gradle.org/docs/2.2.1/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.

System information

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic info

Your system information:

 ordova CLI: 6.4.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v5.5.0
Xcode version: Not installed

I have tried multiple solutions that I found in a question, which I will put the link below:

question link

    
asked by Pedro Miguel Pimienta Morales 20.12.2016 в 06:19
source

2 answers

1

The error is due to the "heap size" reaching its limit.

  

Error occurred during initialization of VM Could not book enough   space for 2097152KB object heap

On the internet you will find several options to change the heap size, but the only variable to change is the one related to MaxHeapSize :

From the menu go to Help > Edit Custom VM Options to open the .exe.vmoptions file

there you can configure

-Xms512m  

It is usually set at 256m, so you can change to 512m and if that is not enough at 1024m.

You can also configure the "Max Heap Size" from File from Android Studio. Settings > Compiler and in Command-line Options , add:

-XX:MaxHeapSize=1024m

    
answered by 20.12.2016 в 18:29
-1

It is a memory problem to generate the virtual machine

  

Error occurred during initialization of VM

     

Could not reserve enough space for object heap

     

Could not create the Java virtual machine.

To solve, go to Setting from File in the top menu or press ctrl + alt + s
Then go to: Build, Executions, Deployment - > Compiler And enter the following line in Additional build process VM options:

-XX:MaxHeapSize=512m

Video answer: video

EDITO Here are several solutions: solutions

    
answered by 20.12.2016 в 14:50