ERROR: Unable to start the daemon process. This problem might be caused by incorrect configuration o

背景: 

在运行第一个基于鸿蒙OS的程序时,出现了如下报错信息

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 Manual chapter on the daemon at https://docs.gradle.org/5.4.1/userguide/gradle_daemon.htmlProcess command line: D:\DevEco Studio\jbr\bin\java.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError // éç½®ç¼è¯æ¶çèææºå¤§å° -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=CN -Duser.language=zh -Duser.variant -cp C:\Users\Administrator.gradle\wrapper\dists\gradle-5.4.1-all\3221gyojl5jsh0helicew7rwx\gradle-5.4.1\lib\gradle-launcher-5.4.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.4.1Please read the following process output to find out more:-----------------------����: �Ҳ������޷��������� ..OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 -----------------------Check the JVM arguments defined for the gradle process in: - gradle.properties in project root directory - gradle.properties in in GRADLE_USER_HOME directory

解决办法:

在操作系统当前用户的.gradle文件夹下:C:\Users\Administrator\.gradle 设置gradle.properties,若无就新增。
在文件中添加如下配置信息:

org.gradle.jvmargs=-Xmx512m 

然后点击File>>Sync Project with Gradle File 即可构建成功

如果觉得文章有帮助到你,可以扫描以下二维码
   请本文作者 喝一杯
pay_weixin pay_weixin

发表评论

电子邮件地址不会被公开。 必填项已用*标注