Could not find com.android.tools.build:gradle:3.1.0.

androidstudio导入项目后,报错:Could not find com.android.tools.build:gradle:3.1.0.
解决办法:
项目根目录的 build.gradle文件中添加其他可供下载的仓库:google()、 jcenter()、mavenCentral()
Could not find com.android.tools.build:gradle:3.1.0._第1张图片

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

你可能感兴趣的:(android,技术文档)