原因:国外网站下载速度太慢
解决:配置aliyun镜像
首先打开build.gradle文件查看plugins中的id和version在以下链接搜索是否存在
https://developer.aliyun.com/mvn/search
如果不存在,那就降低gradle版本到存在的版本
然后在build.gradle文件中添加如下配置
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven { url 'https://maven.aliyun.com/repository/public'}
maven { url 'https://maven.aliyun.com/repository/google'}
}
}
在settting.gradle文件中修改为如下配置文章来源:https://www.toymoban.com/news/detail-745159.html
pluginManagement {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven { url 'https://maven.aliyun.com/repository/spring-plugin'}
maven { url 'https://maven.aliyun.com/repository/public'}
maven { url 'https://maven.aliyun.com/repository/google'}
gradlePluginPortal()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories{
mavenLocal()
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven { url 'https://maven.aliyun.com/repository/public'}
maven { url 'https://maven.aliyun.com/repository/google'}
}
}
最后重新File --> Sync project with gradle files文章来源地址https://www.toymoban.com/news/detail-745159.html
到了这里,关于Android Studio gradle 8.0 版本安装出现 Read Timed Out的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!