0
votes

ANDROID_HOME=C:\Users\manish\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_121 Subproject Path: CordovaLib To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/3.3/userguide/gradle_daemon.html.

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/3.3/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 1572864KB object heap

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. (node:4316) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
1

1 Answers

0
votes

// find the file gradlebuilder.js

// It should be here in your application Drive:\"your Application path"\platforms\android\cordova\lib\builders

GradleBuilder.prototype.getArgs = function(cmd, opts) {
if (cmd == 'release') {
    cmd = 'cdvBuildRelease';
} else if (cmd == 'debug') {
    cmd = 'cdvBuildDebug';
}
var args = [cmd, '-b', path.join(this.root, 'build.gradle')];
if (opts.arch) {
    args.push('-PcdvBuildArch=' + opts.arch);
}

// 10 seconds -> 6 seconds
args.push('-Dorg.gradle.daemon=false');

// to solve gradle Error occurred during initialization of VM //Could not reserve enough space for 1572864KB object heap then we need to some changes in this code //args.push(('-Dorg.gradle.daemon=true');) // to allow dex in process with this code args.push('-Dorg.gradle.jvmargs=-Xmx1024m'); args.push('-Dorg.gradle.jvmargs=-Xmx1536m');

// allow NDK to be used - required by Gradle 1.5 plugin
args.push('-Pandroid.useDeprecatedNdk=true');
args.push.apply(args, opts.extraArgs);
// Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
// args.push('-Dorg.gradle.parallel=true');
return args;`enter code here`

};

Note : 1. to allow dex in process with this code args.push('-Dorg.gradle.jvmargs=-Xmx1024m'); 2. args.push(('-Dorg.gradle.daemon=true');)