首页 > 编程语言 > Android Studio error: Unable to start the daemon process的解决方法
2020
10-10

Android Studio error: Unable to start the daemon process的解决方法

在 Android Studio 上新建项目,出现 Unable to start the daemon process. 错误,具体错误信息如下:

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 https://docs.gradle.org/3.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

解决方法一、

方法一:删除 C:\Users\UserName\.gradle 目录,重新启动 Android Studio即可。重启动后,它会自动为你创建一个新的。

方法二:修改配置。File -> Settings. 选择左边导航栏的Compiler项,设置 VM Options 为 -Xmx512m即可。

方法三:其它应该,留出更多的内存空间试试。

解决方法二、

在stackoverflow上找到解决方法:
Android Studio默认为Gradle daemon process分配的heap size过大(windows平台下默认最大heap size为:75% of total physical memory up to 1 GB),所以容易造成空间不足无法启动的问题。把空间配置稍小一点即可。
在Android Studio中进入

File->Settings->Compiler

将VM Options配置为一个较小的值,如-Xmx512m。

重启Android Studio问题解决。

解决方法三、

1、可能是由于杀毒软件等卸载或者禁止了daemon进程,因此,重启电脑可以解决该问题.
2、进入Chapter 6. The Gradle Daemon进行配置,其主要讲述C:\Users\Administrator\.gradle路径下(其中Administrator是自己的用户名),新建gradle.properties文件,并写入org.gradle.daemon=true

一般添加 org.gradle.jvmargs=-Xmx512m 好了

编程技巧