【问题标题】:Gradle error - ionic build androidGradle 错误 - 离子构建 android
【发布时间】:2017-05-05 06:02:42
【问题描述】:

我正在尝试使用命令ionic build android 编译一个新项目,但我收到此错误:

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\sqliteTest\hooks\after_prepare\010_add_platform_class.js C:\Users\pedromiguel\aplicacionesIonic\sqliteTest


add to body class: platform-android

ANDROID_HOME=C:\Users\pedromiguel\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

Subproject Path: CordovaLib



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 2097152KB object heap


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

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 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 2097152KB object heap


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

系统信息

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic info

Your system information:

 ordova CLI: 6.4.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v5.5.0
Xcode version: Not installed

我尝试了多种解决方案,我发现它是以下问题:

Link 1

【问题讨论】:

    标签: android ionic-framework


    【解决方案1】:

    您的路径应该是错误的。首先检查您的 java 设置。参考以下链接https://forum.ionicframework.com/t/unable-to-start-the-daemon-process/34301/5

    如果它不起作用,则将 gradle.property 更改为 打开 Android Studio 然后转到 gradle.properties 文件并将最后一行更改为

    org.gradle.jvmargs=-Xmx1024m.

    然后按重试。参考Android Studio Gradle project "Unable to start the daemon process /initialization of VM"

    【讨论】:

    • 是的,但这只会在创建新项目时发生
    【解决方案2】:

    我通过用原始 gradle 文件替换完整的 Gradle 文件解决了这个问题。它对我有用。

    【讨论】:

    • 原始文件在哪里?
    • 实际上我只是从我的同事那里复制了 .gradle 文件并替换了 C:\Users\user\.gradle 中的文件
    • 你从其他安装的电脑上复制文件?
    猜你喜欢
    • 2018-08-27
    • 2015-11-16
    • 2017-02-05
    • 1970-01-01
    • 2016-11-06
    • 1970-01-01
    • 1970-01-01
    • 2016-06-15
    相关资源
    最近更新 更多