ERROR: Unable to resolve dependency for ’ xxx ’ : Could not download xxx (com.android.support:design:xxx)
这个问题相信也困扰了很多人,用了一些网上的方法好像也不太见效,个人还是觉得用镜像的方法比较靠谱。
只需要在你项目工程里面的build.gradle文件中 buildscript 和 allprojects 中添加依赖,如下
buildscript {
repositories {
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
google()
jcenter()
}
}
allprojects {
repositories {
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
google()
jcenter()
}
}