我尝试使用命令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
我尝试了多种解决方案,我发现这些是以下问题:
答案 0 :(得分: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"
答案 1 :(得分:0)
我通过用原始gradle文件替换完整的Gradle文件来修复此问题。它对我有效。