Gradle build is hanging without failure, DefaultFi

2020-07-17 14:16发布

问题:

I have several gradle-based projects and on all of them recently I've become unable to execute a ./gradlew clean build. Upon running this, the When I run with the --debug flag, I get stuck on "> Building 7% > :compileJava > Resolving dependencies ':compileClasspath'" and it never moves forward.

When I ran with the --debug flag, I got this output regarding the DeafultFileLockManager acquiring and releasing a daemon lock, but this has been unhelpful. Here is the last bit of the gradle debug log that I see.

11:22:57.079 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://maven.vaadin.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
11:22:57.080 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 203][route: {s}->https://maven.vaadin.com:443][total kept alive: 0; route allocated: 2 of 2; total allocated: 2 of 20]
11:22:57.080 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://maven.vaadin.com:443
11:22:57.080 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to maven.vaadin.com/54.86.23.48:443
11:22:57.080 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to maven.vaadin.com/54.86.23.48:443 with timeout 0
11:22:57.098 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
11:22:57.098 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
11:22:57.098 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
11:22:57.141 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established
11:22:57.141 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  negotiated protocol: TLSv1.2
11:22:57.142 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
11:22:57.142 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  peer principal: CN=*.vaadin.com, O=Vaadin Ltd, L=Turku, ST=Western Finland, C=FI
11:22:57.142 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  peer alternative names: [*.vaadin.com, vaadin.com]
11:22:57.142 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  issuer principal: CN=DigiCert SHA2 Secure Server CA, O=DigiCert Inc, C=US
11:22:57.142 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 10.10.2.46:54773<->54.86.23.48:443
11:22:57.142 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request HEAD /vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.pom HTTP/1.1
11:22:57.142 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
11:22:57.142 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
11:22:57.163 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-203: Close connection
11:22:57.166 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded
11:22:57.166 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-203: Close connection
11:22:57.166 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 203][route: {s}->https://maven.vaadin.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
11:22:57.166 [INFO] [org.gradle.internal.resource.transport.http.HttpClientHelper] Resource missing. [HTTP HEAD: https://maven.vaadin.com/vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.pom]
11:22:57.167 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://maven.vaadin.com/vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.jar
11:22:57.167 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource metadata: https://maven.vaadin.com/vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.jar
11:22:57.167 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP HEAD: https://maven.vaadin.com/vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.jar
11:22:57.167 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
11:22:57.167 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
11:22:57.167 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://maven.vaadin.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
11:22:57.167 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 204][route: {s}->https://maven.vaadin.com:443][total kept alive: 0; route allocated: 2 of 2; total allocated: 2 of 20]
11:22:57.167 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://maven.vaadin.com:443
11:22:57.167 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to maven.vaadin.com/54.86.23.48:443
11:22:57.167 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to maven.vaadin.com/54.86.23.48:443 with timeout 0
11:22:57.186 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
11:22:57.186 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
11:22:57.186 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
11:22:57.207 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established
11:22:57.207 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  negotiated protocol: TLSv1.2
11:22:57.207 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
11:22:57.207 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  peer principal: CN=*.vaadin.com, O=Vaadin Ltd, L=Turku, ST=Western Finland, C=FI
11:22:57.207 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  peer alternative names: [*.vaadin.com, vaadin.com]
11:22:57.207 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  issuer principal: CN=DigiCert SHA2 Secure Server CA, O=DigiCert Inc, C=US
11:22:57.207 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 10.10.2.46:54774<->54.86.23.48:443
11:22:57.207 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request HEAD /vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.jar HTTP/1.1
11:22:57.207 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
11:22:57.207 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
11:22:57.230 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-204: Close connection
11:22:57.234 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded
11:22:57.234 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-204: Close connection
11:22:57.234 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 204][route: {s}->https://maven.vaadin.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
11:22:57.234 [INFO] [org.gradle.internal.resource.transport.http.HttpClientHelper] Resource missing. [HTTP HEAD: https://maven.vaadin.com/vaadin-addons/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.jar]
11:22:57.234 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'info.magnolia:magnolia-module-content-dependencies:1.6.1' in repository 'vaadin-addons'.
11:22:57.234 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetaDataCache] Recording absence of module descriptor in cache: info.magnolia:magnolia-module-content-dependencies:1.6.1 [changing = false]
11:22:57.235 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://nexus.magnolia-cms.com/content/groups/enterprise/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.pom
11:22:57.235 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://nexus.magnolia-cms.com/content/groups/enterprise/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.pom
11:22:57.235 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource metadata: https://nexus.magnolia-cms.com/content/groups/enterprise/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.pom
11:22:57.235 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP HEAD: https://nexus.magnolia-cms.com/content/groups/enterprise/info/magnolia/magnolia-module-content-dependencies/1.6.1/magnolia-module-content-dependencies-1.6.1.pom
11:22:57.236 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
11:22:57.236 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
11:22:57.236 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://nexus.magnolia-cms.com:443][total kept alive: 0; route allocated: 2 of 2; total allocated: 2 of 20]
11:23:06.177 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:23:06.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:06.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:16.177 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:23:16.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:16.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:16.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:16.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:16.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:16.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:26.179 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:23:26.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:26.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:26.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:26.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:26.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:26.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:36.180 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:23:36.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:36.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:36.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:36.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:36.181 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:36.181 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:46.176 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:23:46.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:46.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:46.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:46.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:46.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:46.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:56.179 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:23:56.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:56.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:56.180 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:23:56.181 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:23:56.181 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:23:56.181 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:06.177 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:24:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:06.178 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:06.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:06.179 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:16.176 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:24:16.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:16.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:16.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:16.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:16.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:16.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:26.176 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:24:26.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:26.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:26.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:26.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:26.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:26.177 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:36.175 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:24:36.175 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:36.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:36.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:36.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:36.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:36.176 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:46.173 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:24:46.174 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:46.174 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:46.174 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:46.175 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:46.175 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:46.175 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:56.172 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:24:56.173 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:56.173 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:56.173 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:24:56.173 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:24:56.174 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:24:56.174 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
11:25:06.175 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:25:06.175 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.

回答1:

In order for gradle work properly, you need to configure at least 3 kind of proxies on Linux/macOS which are

  • gradle proxies - inside gradle.properties
  • maven proxies - inside ~/.m2/settings.xml
  • bash proxies - inside ~/.bashrc or ~/.bash_profile

Apart from these proxy settings, you also need to double check your proxy settings of your OS, e.g. on mac, check "System Preferences" -> "Network" -> "Advanced..." -> "Proxies". You may need try to turn on/off this system proxies.

However, sometimes, like your case, it may not because of connectivity problems, but due to permission issues. If you ever ran your gradle commands using "sudo" then some of the directories generated during executing the gradle commands may become owned by "root". Hence, when you try to run gralde commands using normal user, these directories are not accessible. The bad thing is that gradle does not give you any information or even hints to "permission".

The solution to this is as below.

  • To find all the files and directories that are owned by root or belong to root group:

    $ls -alR | grep -w root > list.txt

The result of this command will be output to file list.txt, open it to check all the files and directories. For example you may see the output something as below:

drwxrwxr-x+ 86 root  admin   2.9K Jun 29 20:30 Applications/
drwxr-xr-x+ 65 root  wheel   2.2K May 19 00:19 ***/.gradle
drwxr-xr-x@  2 root  wheel    68B Nov 20  2016 ***/build
drwxr-xr-x@  4 root  wheel   136B Jun 29 20:31 .gradle
drwxr-xr-x    3 employee  staff   102B Nov 10  2015 Samsung/
drwxr-xr-x    7 employee  staff   238B Jul  6  2016 VirtualBox VMs/
drwxr-xr-x    3 employee  staff   102B Nov  4  2016 android-ndk/
drwxr-xr-x    3 employee  staff   102B Aug 31  2016 bin/
  • To find the exact location of those files or directories

    $find "$PWD" | grep your-file-name

  • Delete those files or directories.

    $ sudo rm -rf your-file-name

Usually, you need change your directory to below locations to perform above actions to delete all the files with root user.

  • ~/.gradle – The .gradle cache under your user’s “Home” directory
  • /.gradle – The .gradle cache under your project root directory
  • [project-root]/[module]/build – The .gradle cache under your gradle module directory.
  • ~/.m2 – The Maven cache directory under your user’s “Home” directory

Then start over a gradle sync, the problem should be resolved.


You can find more detailed descriptions from below blogs:

  1. gradle-sync-issue-on-debian-os-due-to-user-does-not-have-permission
  2. android-gradle-plugin-3-0-sync-issue
  3. gradle-proxy-configuration


回答2:

I had the same issue. In my case setting proxy in ~/gradle/gradle.properties helped:

systemProp.http.proxyHost=hostname
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=user
systemProp.http.proxyPassword=password