问题与处理策略
问题描述
- 在 Android 项目中,报如下警告
The specified Android SDK Build Tools version (28.0.3) is ignored,
as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file,
as each version of the Android Gradle Plugin now has a default version of the build tools.
# 翻译指定的 Android SDK 构建工具版本(28.0.3)已被忽略因为它低于 Android Gradle 插件 4.2.2 的最低支持版本(30.0.2)将使用 Android SDK 构建工具 30.0.2要取消此警告,请从 build.gradle 文件中删除 buildToolsVersion'28.0.3'因为每个版本的 Android Gradle 插件现在都有一个默认版本的构建工具
问题原因
-
Android Gradle Plugin 4.2.2 要求的最低的 Android Build Tools 版本是 30.0.2
-
如果在模块级
build.gradle
文件中指定了一个低于 30.0.2 的 Android Build Tools 版本,Android Gradle Plugin 会忽略设置,并使用默认的 30.0.2
处理策略
- 在模块级
build.gradle
文件中,移除或注释掉以下内容
android {// buildToolsVersion '28.0.3'...
}