【发布时间】:2021-07-30 08:15:07
【问题描述】:
我最近从 4.2.2 升级了我的 Gradle 版本。到 7.0.0。 Android Studio 运行应用程序运行良好,直到我升级并收到以下错误
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.40 and higher.
The following dependencies do not satisfy the required version:
root project 'MyNewApp' -> androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0-alpha03 -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20
下面是我的项目级grale
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
//classpath 'com.android.tools.build:gradle:4.2.2'
def nav_version = "2.3.0-alpha03"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.google.gms:google-services:4.3.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我尝试在 buildscript 下添加 ext.kotlin_version = "1.5.0" 但同样的错误可能是什么问题
【问题讨论】:
-
请使用稳定版2.3.5,因为它有Use Kotlin-plugin 1.4.31 in safe-args 提交。
-
谢谢@Jay 成功了
标签: java android android-studio kotlin gradle