reference: https://forum.ionicframework.com/t/build-failed-unable-start-the-daemon-process/72171
Change argument -Xmx20484m to 1024 at line: args.push(’-Dorg.gradle.jvmargs=-Xmx1024m’); in your project file platforms\android\cordova\lib\builders\GradleBuilder.js.