gpt4 book ai didi

android - 构建 Cordova PhoneGap 时出现 VM 错误

转载 作者:IT老高 更新时间:2023-10-28 23:27:38 26 4
gpt4 key购买 nike

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

cordova build android

我收到了这个错误:

enter image description here

错误

    D:\rmapp>cordova run androidRunning command: D:\rmapp\platforms\android\cordova\run.batANDROID_HOME=D:\Android\sdkJAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_71WARNING : No target specified, deploying to device '192.168.56.100:5555'.Running: D:\rmapp\platforms\android\gradlew cdvBuildDebug -b D:\rmapp\platforms\android\build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=trueFAILURE: 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.htmlPlease read the following process output to find out more:-----------------------Error occurred during initialization of VMCould not reserve enough space for object heapError: 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 --debugoption 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\gradlew 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\cordova\run.bat: Command failed with exit code 1You may not have the required environment or OS to run this project

最佳答案

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

这对我有用:

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

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

关于android - 构建 Cordova PhoneGap 时出现 VM 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30384375/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com