原因:可能是连接超时,导致下载失败,添加镜像即可
老版AndroidStudio: 到build.gradle文件下添加
buildscript {
repositories {
maven {
url 'https://maven.aliyun.com/repository/jcenter'
}
}
}
allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/jcenter'
}
}
}
新版AndroidStudio,要到setting.gradle添加
maven { url "https://jitpack.io" }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }