【Gradle】Android error xxx.jar read timed out

1. Environment

环境:idea开发Android 自配置绿色版gradle-6.7.1,Gradle相关配置和Android studio应该是一致的


2.Solution

Modify the configuration file and change it to the Alibaba Cloud warehouse. What you need to pay attention to is which configuration file to change.
Generally speaking, you modify build.gradle , but because I am using the green version of gradle-6.7.1 here , I also configured the specified location in the idea. , as shown below,
so the configuration file I modified is the configuration file in the decompression directory of the green version, example:
D:\gradle-6.7.1\ins\init.d\init.gradle


Insert image description here


The modified results are as follows:

allprojects {
    repositories {
		maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/google/'}
        maven { url 'https://maven.aliyun.com/repository/jcenter/'}
        mavenLocal()
        mavenCentral()
    }

    buildscript { 
        repositories { 
			maven { url 'https://maven.aliyun.com/repository/public/' }
			maven { url 'https://maven.aliyun.com/repository/google/'}
			maven { url 'https://maven.aliyun.com/repository/jcenter/'}
			mavenLocal()
			mavenCentral()
        }
    }
}

3. Other options

Solve it locally by downloading the package and placing it for reference.

“Could not resolve all files for configuration ‘:classpath’.” error

おすすめ

転載: blog.csdn.net/cjl836735455/article/details/125367176