Cordova构建时出现Gradle错误

时间:2018-03-30 05:19:12

标签: android cordova gradle

关闭英特尔XDK后,我开始寻找另一种工具将我的html5 / phaser游戏转换为android。所以,我在YouTube上观看了一些视频,并决定尝试使用Cordova和Node.js命令行。

我下载并安装了Android Studio,Node.js和JDK(8u162版本,因为它是Windows 32位的最新版本,正如我所见)。

使用node.js命令行安装cordova并创建一个新项目后,我尝试构建我的项目,我有下一个错误:

D:\Android\Development\datesniper>cordova prepare
Android Studio project detected

D:\Android\Development\datesniper>cordova build android --debug
Android Studio project detected
ANDROID_HOME=C:\Users\Aleksey\AppData\Local\Android\sdk
JAVA_HOME=D:\Java\jdk-8u162
studio
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon (subsequent builds will be faster)

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

* Get more help at https://help.gradle.org
(node:4316) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with ex
it 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/
4.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.

* Get more help at https://help.gradle.org
    at ChildProcess.whenDone (D:\Android\Development\datesniper\platforms\androi
d\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:4316) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
 id: 1)
(node:4316) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

D:\Android\Development\datesniper>

我该怎么办?是否有其他(不太复杂)的方式将我的相位器游戏转换为android?

谢谢!

更新:当我尝试在Android Studio中创建新项目时,构建时出错: Gradle sync失败:CreateProcess error = 216,Version"%1"与此计算机上运行的Windows版本不兼容。

如何替换32位Windows的gradle版本?

0 个答案:

没有答案
相关问题