【问题标题】:Your project requires a newer version of the Kotlin Gradle plugin, ext.kotlin_version = '<latest-version>'您的项目需要更新版本的 Kotlin Gradle 插件 ext.kotlin_version = \'<latest-version>\'
【发布时间】:2022-11-01 23:27:45
【问题描述】:

我的颤振项目没有构建并引发以下错误:

您的项目需要更新版本的 Kotlin Gradle 插件。查找 最新版本在 https://kotlinlang.org/docs/gradle.html#plugin-and-versions 然后 在 android/build.gradle 中更新相同的内容

作为ext.kotlin_version=&lt;latest-version&gt;

我已按照建议将 android/build.gradle 中的 build.gradle 更新为以下内容:

ext.kotlin_version = '1.7.20' 

但是,错误继续存在。通过运行检查 gradle 版本

./gradlew --version

我得到以下结果:

Gradle 7.4.2
------------------------------------------------------------

Build time:   2022-03-31 15:25:29 UTC
Revision:     540473b8118064efcc264694cbcaa4b677f61041

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          18.0.2.1 (Oracle Corporation 18.0.2.1+1-1)
OS:           Windows 11 10.0 amd64

帮助表示赞赏。

【问题讨论】:

  • Kotlin Gradle 插件与 Kotlin 版本不同。
  • @TheLibrarian,我该如何解决这个错误。此外,我刚刚根据我的知识更新了信息。
  • 找到使用kotlin-gradle-pluginbuild.gradle 文件并增加版本:-)

标签: flutter kotlin gradle android-gradle-plugin build.gradle


【解决方案1】:

你应该检查 gradle 版本

使用相同的版本 1.5.31

classpath  'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'

【讨论】:

    猜你喜欢
    • 2022-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-11
    • 2019-06-02
    • 2023-04-11
    • 2019-07-03
    相关资源
    最近更新 更多