【发布时间】:2018-02-11 12:46:38
【问题描述】:
我尝试为 Android 生成一个发布版本,但在命令之后:“ionic cordova build --release android”我遇到了异常:
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:7276) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 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/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:7276) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
我试过这个: 转到开始->控制面板->系统->高级(选项卡)->环境变量->系统变量->新建: 变量名:_JAVA_OPTIONS 变量值:-Xmx512M GRADLE_OPTS:-Xmx2048M 还有这个:所以你必须有 Android Api 23 才能让这个命令工作。 安装 Api 23 等后,Daemon 进程的错误将得到解决 构建工具并运行命令 我已经加载了最新版本的 jdk/jre(64 位) 我尝试用这个来制作一个 gradle.properties:org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m 但是这个异常还是会出现。请帮忙
【问题讨论】:
标签: java android cordova ionic-framework