Minimum supported Gradle version is 6.1.1
查看两个版本号的方式:
1. Android studio 的Android gradle 版本:
Help -> About -> Android Studio 3.5.2 (其实就是当前studio版本)
2. 项目的Android gradle依赖
-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
buildscript {
-
dependencies {
-
classpath "com.android.tools.build:gradle:4.0.1"
-
// NOTE: Do not place your application dependencies here; they belong
-
// in the individual module build.gradle files
-
}
-
}
因此只需要把上面的 修改为 当前Studio 的版本号
classpath "com.android.tools.build:gradle:3.5.2"
再重新同步即可。
当然,也可以通过修改gradle-wrapper.properties (distributionUrl表示gradle版本对应的下载URL)
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip