FAILURE: Build failed with an exception. While building android apk in ionic

By | July 12, 2018
Questions:

I tried converting my app into android apk through the cmd using ionic cordova build androidseverally but this error keeps displaying everytime I run the command.

I have installed gradle using Chocolatey as the installer but still nothing changed.

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

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
    (node:440) UnhandledPromiseRejectionWarning: 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 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
      at ChildProcess.whenDone (c:\Users\Infonet\schoolEvaluation\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
      at ChildProcess.emit (events.js:180:13)
      at maybeClose (internal/child_process.js:936:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
      (node:440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:440) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I need your help guys as I am to show the app for testing tomorrow for my presentation.

Thanks.

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *