# Build failed with an exception

**URL:** <https://forum.ionicframework.com/t/build-failed-with-an-exception/158375>\
**Category:** Ionic Native\
**Created:** [March 6, 2019, 4:57pm UTC](https://forum.ionicframework.com/t/build-failed-with-an-exception/158375 "2019-03-06T16:57:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saneta](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/saneta/32/124607_2.png) [@saneta](https://forum.ionicframework.com/u/saneta)\
**Post date:** [March 6, 2019, 4:57pm UTC](https://forum.ionicframework.com/t/build-failed-with-an-exception/158375/1 "2019-03-06T16:57:59Z")

</div>

Hello. Help.

Android Studio project detected  
ANDROID\_HOME=C:\Program Files\Android\android-sdk  
JAVA\_HOME=C:\Program Files\Java\jdk1.8.0\_201  
studio  
Subproject Path: CordovaLib  
Subproject Path: app  
Starting a Gradle Daemon (subsequent builds will be faster)

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 [https://docs.gradle.org/4.1/userguide/gradle\_daemon.html](https://docs.gradle.org/4.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.

- Get more help at [https://help.gradle.org](https://help.gradle.org)  
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 [https://docs.gradle.org/4.1/userguide/gradle\_daemon.html](https://docs.gradle.org/4.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.

- Get more help at [https://help.gradle.org](https://help.gradle.org)  
[ERROR] An error occurred while running subprocess cordova.

---

<div class="post-metadata">

**Author:** ![Tommertom](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Tommertom](https://forum.ionicframework.com/u/Tommertom)\
**Post date:** [August 25, 2019, 9:24am UTC](https://forum.ionicframework.com/t/build-failed-with-an-exception/158375/2 "2019-08-25T09:24:40Z")

</div>

Running late to the party here, but I had my head banging the wall for a full day on this error yesterday, finding out that I installed 32bit JDK instead of 64bit…

Solved it for me.
