赞
踩
原因:国外网站下载速度太慢
解决:配置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文件中修改为如下配置
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。