Android Studio报错:ERROR: Failed to resolve: com.android.support:appcompat-v7:28.0.+


今天新导入一个Project项目,上来就报错找不到类库,Google狠起来自己的儿子都编译不过了么?吐血,如下:
ERROR: Failed to resolve: com.android.support:appcompat-v7:28.0.+
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app

ERROR: Failed to resolve: com.android.support:recyclerview-v7:28.0.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app

ERROR: Failed to resolve: com.android.support.test.espresso:espresso-core:2.2.2
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app

尝试各种Clear、Rebuild无果后放弃了,还得去StackOverflow寻找良方,果然不负众望,找到了答案:
Failed to resolve: com.android.support:appcompat-v7:28.0
项目级Gradle中repositories的jcenter()下一行添加如下maven代码即可:

allprojects {
    repositories {
        jcenter()
        maven {// here we go!!
            url 'https://maven.google.com'
        }
    }
}

再编译,完美运行。

08-19 18:27