VM错误,同时Build Cordova PhoneGap [英] VM error while Build Cordova PhoneGap

查看:289
本文介绍了VM错误,同时Build Cordova PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试创建 Cordova PhoneGap 应用程序时遇到此错误,并在最后一步使用build命令

  cordova build android 

我遇到这个错误:



>



错误



 
D:\rmapp> cordova run android
运行命令:D:\rmapp \platforms\android\cordova\run.bat
ANDROID_HOME = D:\Android\sdk
JAVA_HOME = C:\Program文件(x86)\Java \jdk1。 7.0_71
警告:未指定目标,部署到设备192.168.56.100:5555。
运行:D:\rmapp\platforms\android\gradlew cdvBuildDebug -b D:\rmapp\platform
s\android\build.gradle -PcdvBuildArch = x86 -Dorg。 gradle.daemon = true

FAILURE:构建失败,出现异常。

*出错:
无法启动守护进程。
此问题可能是由于守护程序的配置不正确造成的。
例如,使用无法识别的jvm选项。
请参阅用户指南一章的守护程序,位于http://gradle.org/docs/2
.2.1 / userguide / gradle_daemon.html
请阅读以下过程输出以查找更多:
-----------------------
VM初始化期间发生错误
无法预留足够的空间对象堆
错误:无法创建Java虚拟机。
错误:发生了致命异常。程序将退出。


*尝试:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug
选项运行以获取更多日志输出。

D:\rmapp\platforms\android\cordova\\\
ode_modules\q\q.js:126
throw e;
^
命令的错误代码1:cmd with args:/ s / cD:\ rmapp\platforms\android\grad
lew cdvBuildDebug -b D:\ rmapp \platforms\android\build.gradle -PcdvBuildArch = x86
-Dorg.gradle.daemon = true
运行一个或多个平台的错误:错误:D:\rmapp\\ \\platforms\android\c
ordova\run.bat:命令失败,退出代码为1
您可能没有运行此项目所需的环境或操作系统

解决方案

您的系统无法为jvm提供足够的连续内存空间并导致问题。



这对我有用:



添加一个环境变量 GRADLE_OPTS -Dorg.gradle.jvmargs = -Xmx512m



您可以使用 -Xmx1g 如果您有更多的可用内存空间。


I got this error while i tried to create a Cordova PhoneGap application, and in the final step while I use the build command

cordova build android

I got this error:

Error

    
D:\rmapp>cordova run android
Running command: D:\rmapp\platforms\android\cordova\run.bat
ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_71
WARNING : No target specified, deploying to device '192.168.56.100:5555'.
Running: D:\rmapp\platforms\android\gradlew cdvBuildDebug -b D:\rmapp\platform
s\android\build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true

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 http://gradle.org/docs/2
.2.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 object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

D:\rmapp\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c "D:\rmapp\platforms\android\grad
lew cdvBuildDebug -b D:\rmapp\platforms\android\build.gradle -PcdvBuildArch=x86
 -Dorg.gradle.daemon=true"
ERROR running one or more of the platforms: Error: D:\rmapp\platforms\android\c
ordova\run.bat: Command failed with exit code 1
You may not have the required environment or OS to run this project

解决方案

Your system can not provide enough continuous memory space for the jvm and causes the problem.

Here is what works for me:

Add an environment variable GRADLE_OPTS with the value of -Dorg.gradle.jvmargs=-Xmx512m

You can use -Xmx1g if you have more memory space available.

这篇关于VM错误,同时Build Cordova PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆