是 project 下的 build.gradle 中的 com.android.tools.build:gradle 版本太低的原因,我改成 3.5.2 后问题解决。
// 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.5.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
ext {
compileSdkVersion = 25
buildToolsVersion = "28.0.3"
targetSdkVersion = 25
versionCode = 800800
versionName = "0.8.8"
}
wrapper {
gradleVersion = '2.14.1'
}