cordova离子初始化VM时发生错误

时间:2016-11-17 09:59:54

标签: android cordova ionic-framework phonegap-build hybrid-mobile-app

我是Cordova的新手,我已经创建了项目,但是当我尝试使用命令“cordova build android”构建项目时,我收到以下错误消息:

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/
2.14.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.

我正在使用Ionic框架,请帮助完成这项工作!

谢谢!

1 个答案:

答案 0 :(得分:0)

我可以看到它是堆上的内存问题。您必须配置jvmargs

解决方案是在用户主目录(C:\ Users \ username.gradle或〜.gradle)中创建文件gradle.properties并设置jvm选项:

org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m

请注意,根据您的操作系统,1024m可能会抛出错误,所以尝试使用512m。

对于这个故事,他标记Xmx指定Java虚拟机(JVM)的最大内存分配池。