android - cordova 虚拟机初始化期间发生错误

标签 android cordova jvm phonegap-plugins heap-memory

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

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
Could not create the Java virtual machine.


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

G:\HelloApp\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c ""G:\HelloApp\platforms\android\gradlew" cdvBuildDe
bug -b "G:\HelloApp\platforms\android\build.gradle" -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
    at ChildProcess.whenDone (C:\Users\Admin\AppData\Roaming\npm\node_modules\
cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1008:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

我尝试过以下选项:

  1. 路径中正确设置了Android、java、ant & java、android & ant命令可以从命令行执行
  2. 尝试关闭我的机器上所有正在运行的应用程序,但仍然无法解决问题(我的机器是带有 8GB RAM 的 intel i7 处理器)。

最佳答案

最初我将 JAVA_HOME 设置为 JDK1.6,我安装了 JDK1.7 并相应更新了 JAVA_HOME,问题已解决。

谢谢。

关于android - cordova 虚拟机初始化期间发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31125294/

相关文章:

java - 是否可以在多台电脑上运行一个jvm?

android - PhoneGap/Cordova 日历集成 (Android)

android - Cordova Android 状态栏和标题之间的空白

java - LDC 指令代码的负值是什么意思?

android - ListView 使用两个光标适配器?

javascript - Cordova 闹钟

java - 虚拟内存每秒增加 - 内存不足错误

android - 父 RecyclerView 拾取旨在用于嵌套 RecyclerView 的手势

android - 在 Mac OS X 上哪里安装 Android SDK?

android - iFrame allowFullScreen 属性在 Android WebView 上不起作用