我正在开发一个 React Native 应用程序,最近在更新 Android Studio 后遇到了一个问题。系统提示我更新,更新后,我运行了“同步项目”,结果出现以下警告:
“指定的 Android SDK 构建工具版本 (33.0.0) 将被忽略,因为它低于 Android Gradle 插件 8.1.1 支持的最低版本 (33.0.1)。 将使用 Android SDK 构建工具 33.0.1。 要抑制此警告,请从 build.gradle 文件中删除“buildToolsVersion '33.0.0'”,因为每个版本的 Android Gradle 插件现在都有默认版本的构建工具。”
但是,我的build.gradle文件设置如下:
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "25.1.8937393"
kotlinVersion = "1.8.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
尽管警告提示“buildToolsVersion '33.0.0'”存在问题,但我的配置明确指定了 buildToolsVersion =“34.0.0”。我不确定是什么导致了这种不匹配或如何解决该警告。谁能帮助澄清这里可能出了什么问题或者如何正确解决这个问题?
预先感谢您的协助!
您必须查看日志。就我而言,问题在于
react-native-reanimated
库。
> Configure project :react-native-reanimated
Android gradle plugin: 8.5.0
Gradle: 8.8
WARNING: The specified Android SDK Build Tools version (33.0.0) is ignored, as it is below the minimum supported version (34.0.0) for Android Gradle Plugin 8.5.0.
Android SDK Build Tools 34.0.0 will be used.
To suppress this warning, remove "buildToolsVersion '33.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
有了这些信息,您可能可以更好地了解哪个库是罪魁祸首。