Gradle error - ionic build android

I am try to compile an new project using command ionic build android, but i get this error:

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\sqliteTest\hooks\after_prepare\010_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 info

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 tried multiples solution's, i find it these the follow question:

Link 1

Upvotes: 1

Views: 1508

Answers (2)

Manoj Rejinthala
Manoj Rejinthala

Reputation: 542

I fixed this problem by replacing complete Gradle file with original gradle file.It worked for me.

Upvotes: 0

Anuj
Anuj

Reputation: 650

Your path should be wrong .Check your java setup first. Refer following link https://forum.ionicframework.com/t/unable-to-start-the-daemon-process/34301/5

If it will not work then change gradle.property by Open Android Studio then go to gradle.properties file and change the last line to

org.gradle.jvmargs=-Xmx1024m.

And then press try again . Refer Android Studio Gradle project "Unable to start the daemon process /initialization of VM"

Upvotes: 1

Related Questions