android studio升级之后项目报错Could not find com.android.tools.build:aapt2:3.2.1-4818971

导致问题的原因为源代码根目录下的build.gradle中缺少对于google源服务器的配置(话说,貌似以前版本的都在jcenter中可以找到,最新版本的,好像没有上传到jcenter服务器了,估计是google的商业策略了,在此不多做评述)

下面增加

google()

增改后如下

// Top-level build file where you can add configuration options common to all sub-projects/modules.

 
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
    }
}
 
allprojects {
    repositories {
        google()
        jcenter()
    }
}
原文地址:https://www.cnblogs.com/zyb2016/p/11757017.html