今天使用android studio第一次创建项目时出现这个BUG
Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Install Repository and sync project
Open File
Show in Project Structure dialog
Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Install Repository and sync project
Open File
Show in Project Structure dialog
解决方案
在build.gradle文件中修改如下代码
allprojects {
repositories {
jcenter()//需要添加的第一行
mavenCentral()
maven { url “https://maven.google.com” }//需要添加的第二行
}
}