当前位置: 首页 > 知识库问答 >
问题:

Android Studio:无法启动守护进程

裴英锐
2023-03-14

当我试图在Android Studio中导入一个gradle项目时,我遇到了以下错误。

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.8/userguide/gradle_daemon.html
Please read below process output to find out more: 

这是我看到的输出:

18:25:42.484 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252]
18:25:43.254 [main] DEBUG o.g.l.daemon.server.DaemonServices - Creating daemon context with opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252]
18:25:43.306 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@47078ad, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@7402a821, org.gradle.logging.internal.JavaUtilLoggingConfigurer@5a6c4a07]
18:25:43.356 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=e58252c1-7a49-4be4-a6cd-1bd3d6d0880d,javaHome=C:\Program Files\Java\jdk1.7.0_45,daemonRegistryDir=C:\Users\Sowmya\.gradle\daemon,pid=15432,idleTimeout=60000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
18:25:43.362 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] updating lastActivityAt to 1386593743362
18:25:43.702 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface lo
18:25:43.705 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? true
18:25:43.706 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /127.0.0.1
18:25:43.707 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /0:0:0:0:0:0:0:1
18:25:43.708 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface net0
18:25:43.711 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
DefaultDaemonContext[uid=e58252c1-7a49-4be4-a6cd-1bd3d6d0880d,javaHome=C:\Program Files\Java\jdk1.7.0_45,daemonRegistryDir=C:\Users\Sowmya\.gradle\daemon,pid=15432,idleTimeout=60000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
18:25:43.951 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
18:25:43.954 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
18:25:43.957 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
18:25:43.962 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
18:25:43.963 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
18:25:43.966 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
18:25:43.976 [ERROR] [system.err] 
18:25:43.977 [ERROR] [system.err] FAILURE: Build failed with an exception.
18:25:43.977 [ERROR] [system.err] 
18:25:43.978 [ERROR] [system.err] * What went wrong:
18:25:43.979 [ERROR] [system.err] Could not write cache value to 'C:\Users\Sowmya\.gradle\daemon\1.8\registry.bin'.
18:25:43.979 [ERROR] [system.err] 
18:25:43.980 [ERROR] [system.err] * Try:
18:25:43.981 [ERROR] [system.err] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
18:25:44.009 [INFO] [org.gradle.launcher.daemon.bootstrap.DaemonMain] Daemon[pid = 15432] process has finished.
18:25:44.010 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Removing daemon address: [9ae053cd-4dc2-4cb8-8f60-bb3c5983eb67 port:55117, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]
18:25:44.011 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
18:25:44.012 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
18:25:44.013 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
18:25:44.014 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
18:25:44.015 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
18:25:44.016 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
18:25:44.021 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] VM shutdown hook was unable to remove the daemon address from the registry. It will be cleaned up later.
org.gradle.api.GradleException: Could not write cache value to 'C:\Users\Sowmya\.gradle\daemon\1.8\registry.bin'.
    at org.gradle.cache.internal.SimpleStateCache.serialize(SimpleStateCache.java:74)
    at org.gradle.cache.internal.SimpleStateCache.access$100(SimpleStateCache.java:28)
    at org.gradle.cache.internal.SimpleStateCache$2.run(SimpleStateCache.java:50)
    at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:198)
    at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:187)
    at org.gradle.cache.internal.OnDemandFileAccess.writeFile(OnDemandFileAccess.java:58)
    at org.gradle.cache.internal.SimpleStateCache.set(SimpleStateCache.java:48)
    at org.gradle.cache.internal.FileIntegrityViolationSuppressingPersistentStateCacheDecorator.set(FileIntegrityViolationSuppressingPersistentStateCacheDecorator.java:38)
    at org.gradle.cache.internal.FileIntegrityViolationSuppressingPersistentStateCacheDecorator.update(FileIntegrityViolationSuppressingPersistentStateCacheDecorator.java:46)
    at org.gradle.launcher.daemon.registry.PersistentDaemonRegistry.remove(PersistentDaemonRegistry.java:109)
    at org.gradle.launcher.daemon.server.Daemon$1.run(Daemon.java:100)
Caused by: java.io.FileNotFoundException: C:\Users\Sowmya\.gradle\daemon\1.8\registry.bin (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at org.gradle.cache.internal.SimpleStateCache.serialize(SimpleStateCache.java:67)
    ... 10 more`

我已经关闭了在SO中的解决方案中提到的防病毒软件。但是似乎什么都不起作用。

共有3个答案

陆子默
2023-03-14

我也有同样的问题。但设法解决无效现金。

从文件菜单-

它为我解决了这个问题。

颜志业
2023-03-14

1.如果您只是在Windows中打开太多应用程序,并使Gradle在Ram中没有足够的内存来启动守护进程。因此,当您遇到这种情况时,您可以关闭一些应用程序,例如iTunes等。然后重新启动您的Android Studio。

2.文件菜单 -

戚俊美
2023-03-14

尝试从C:\User\中删除您的. gradle

 类似资料:
  • 首先,我在删除后下载了lquidbounce的源代码。gradle和我发布了代码信息,希望你们能帮我

  • 错误:无法启动守护进程。此问题可能是由不正确的守护程序配置引起的。例如,使用无法识别的 jvm 选项。请参阅守护程序的用户指南章节,http://gradle.org/docs/1.12/userguide/gradle_daemon.html VM初始化期间发生错误无法为对象堆保留足够的空间无法创建Java虚拟机。

  • Android版本:1.2.2 它显示错误:无法启动守护进程。此问题可能是由于守护进程配置不正确造成的。例如,使用了无法识别的jvm选项。请参阅《用户指南》中关于守护进程的一章,网址为:http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html VM 初始化期间发生错误 无法为对象堆保留足够的空间 错误: 无法创建 Java 虚拟机。错误:发

  • Android Studio 2.2OS版本:Windows 10 Java JRE/JDK版本:1.8.0_51

  • 我无法修复这个错误 错误:无法启动守护进程。此问题可能是由守护进程的错误配置引起的。例如,使用了无法识别的jvm选项。请参阅https://docs.gradle.org/2.8/userguide/gradle_daemon.html 错误:无法创建Java虚拟机。错误:出现致命异常。程序将退出。无效的最大堆大小:-Xmx256ml

  • 我用Ionic创建了一个应用程序,但在尝试构建它时,我遇到了以下错误: 失败:生成失败,出现异常。 问题:无法启动守护进程。此问题可能是由于守护进程的配置不正确造成的。例如,使用了无法识别的jvm选项。请参阅《用户指南》中有关守护程序的章节https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html 请阅读以下流程输出以了解更多信息: VM