Android studio 导入旧项目, 编译时出现:
Could not resolve com.android.tools.build:gradle:3.2.1
原因可能是由于连接仓库 时,网络不太好
修改build.gradle,改成阿里云的仓库,注释Google 官方的仓库
repositories {// mavenLocal()// jcenter()// maven {// url 'https://maven.google.com/'// name 'Google'// }// maven {// url 'http://maven.aliyun.com/nexus/content/repositories/releases/'// } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } }
所以,关键是
maven { url 'https://maven.aliyun.com/repository/google' }maven { url 'https://maven.aliyun.com/repository/jcenter' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }