build_tools_version是 ext 定义的吗?
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.support_version = "26" ext.build_tools_version = "27.0.3" ext.min_sdk_version = 24 repositories { jcenter() google() flatDir { dirs 'src/main/libs' } } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() google() flatDir { dirs 'src/main/libs' } maven { //this //url "https://oss.sonatype.org/content/repositories/snapshots" url "https://maven.google.com" } } }