您的项目需要更新版本的Kotlingradle插件错误

q9yhzks0  于 2023-04-30  发布在  Kotlin
关注(0)|答案(1)|浏览(331)

当我尝试构建应用程序时,它抛出错误-你的项目需要一个更新版本的Kotlingradle插件

[!] Your project requires a newer version of the Kotlin Gradle plugin.                                                                            │
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, 
| then update E:\flutter_apps\geodata\android\build.gradle: │
│ ext.kotlin_version = '<latest-version>'

我已经升级了我的Android/Build。Gradle如下。

buildscript {
    ext.kotlin_version = '1.7.20'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
        classpath 'com.google.gms:google-services:4.3.10'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我的android/gradle/wrapper/ www.example.com 如下

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip

请问有谁可以帮我吗?

vlju58qv

vlju58qv1#

我也有同样的问题。我尝试了多种解决方案。没有一个工作。终于找到了解决办法。在android/build中复制并通过下面的代码。grad勒

buildscript {
ext.kotlin_version = '1.7.10'
repositories {
    google()
    mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:7.2.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.10'

}

并在android/gradle/wrapper/www. example中更改distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip www.example.com

相关问题