更新时间:2023-11-16 13:41:16
最新 Gradle: 6.5
版本检查:
./gradlew -v
如何更新:
./gradlew wrapper --gradle-version=6.5 --distribution-type=all
./gradlew 包装器
最新的 Android Gradle 插件: 4.1.0
如果您将以下代码片段添加到 build.gradle
文件的顶部.Gradle 将更新构建工具.
If you add the following code snippet to the top of your build.gradle
file. Gradle will update the build tools.
buildscript {
repositories {
google() // For Gradle 4.0+
maven { url 'https://maven.google.com' } // For Gradle < 4.0
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
}
}
在此处阅读更多信息:https://developer.android.com/studio/build/index.html 以及这里的版本兼容性:https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle 和 https://dl.google.com/dl/android/maven2/index.html.
Read more here: https://developer.android.com/studio/build/index.html and about version compatibility here: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle and https://dl.google.com/dl/android/maven2/index.html.
我遇到了同样的错误,您需要确保您的 Gradle 版本与您的 Android Gradle 插件兼容.
I had this same error, you need to make sure your Gradle version is compatible with your Android Gradle Plugin.
最新版本的 Gradle 是 2.0,但您需要使用 1.12 才能使用 Android Gradle 插件.
The latest version of Gradle is 2.0 but you need to use 1.12 in order to use the Android Gradle Plugin.