[英]Stuck at starting gradle daemon
I am an Android Developer.我是一名安卓开发者。 Yesterday I opened my current project at Android Studio and the project could not start.
昨天我在 Android Studio 中打开了我当前的项目,但该项目无法启动。
An error was shown:显示错误:
Gradle sync failed: 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/4.4/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Consult IDE log for more details (Help | Show Log) (4s 245ms)
graddle.properties
to org.gradle.jvmargs=-Xmx1024m
but its still not workgraddle.properties
到org.gradle.jvmargs=-Xmx1024m
但它仍然没有工作.gradle
folder on my computer but its still stuck.gradle
文件夹,但它仍然卡住了I need help here, because I can't run my project at all.我在这里需要帮助,因为我根本无法运行我的项目。
Here is the gradle log:这是gradle日志:
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.api.GradleException: 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/4.4/userguide/gradle_daemon.html
Please read the following process output to find out more:
and this is log from daemon log这是来自守护进程日志的日志
20:37:16.805 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback multicast interface Microsoft Wi-Fi Direct Virtual Adapter-QoS Packet Scheduler-0000
20:37:16.805 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter-WFP 802.3 MAC Layer LightWeight Filter-0000
20:37:16.806 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:37:16.808 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:37:16.808 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback multicast interface Microsoft Wi-Fi Direct Virtual Adapter-WFP 802.3 MAC Layer LightWeight Filter-0000
20:37:16.814 [ERROR] [system.err]
20:37:16.814 [ERROR] [system.err] FAILURE: Build failed with an exception.
20:37:16.815 [ERROR] [system.err]
20:37:16.815 [ERROR] [system.err] * What went wrong:
20:37:16.815 [ERROR] [system.err] java.net.BindException: Address already in use: bind
20:37:16.815 [ERROR] [system.err]
20:37:16.815 [ERROR] [system.err] * Try:
20:37:16.815 [ERROR] [system.err] Run with --stacktrace option to get the
stack trace. Run with --info or --debug option to get more log output. Run
with --scan to get full insights.
20:37:16.816 [ERROR] [system.err]
20:37:16.816 [ERROR] [system.err] * Get more help at https://help.gradle.org
Daemon vm is shutting down... The daemon has exited normally or was
terminated in response to a user interrupt.
启动您的本地 VPN 应用程序(例如 1.1.1.1)
Check if you have something like this in any of your gradle files:检查您的任何 gradle 文件中是否有类似的内容:
jvmArgs('someValues')
Go to your project config:转到您的项目配置:
Go to "edit configurations".转到“编辑配置”。 Make sure you select "app".
确保选择“应用程序”。
Check the launch flags.检查启动标志。 Delete them all >:D
全部删除>:D
Clean and rebuild your project清理并重建您的项目
You (or a program) probably changed the jvm's default run options.您(或程序)可能更改了 jvm 的默认运行选项。 Try to change them in your JVM or reinstall java and jdk if you're desperate enough.
如果您足够绝望,请尝试在您的 JVM 中更改它们或重新安装 java 和 jdk。
Let me know how it goes让我知道事情的后续
Go into your home directory and find the .gradle
folder.进入您的主目录并找到
.gradle
文件夹。 Under that folder, there are 2 folder that I delete to remove this issue.在该文件夹下,我删除了 2 个文件夹以解决此问题。 I delete the
.gradle/daemons
and the .gradle/caches
directory.我删除了
.gradle/daemons
和.gradle/caches
目录。 Once I deleted those 2 directories and restarted Intellij/Android Studio, gradle sync started working.一旦我删除了这 2 个目录并重新启动 Intellij/Android Studio,gradle 同步就开始工作了。
On mac/linux在 mac/linux 上
cd ~/.gradle
rm -fr caches daemon
Try to do the following thing尝试做以下事情
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.