1. 程式人生 > >gradle編譯無法初始化jvm問題

gradle編譯無法初始化jvm問題

用gradle編譯ionic程式時,報以下錯誤:
Error: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/1.12/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit

解決方案

在個人資料夾( (C:\Users\username\.gradle 或 ~\.gradle))下建立gradle.properties檔案,新增

org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m
注:可根據自己的需要設定jvm引數-Xmx的大小

相關連結:https://docs.gradle.org/current/userguide/build_environment.html