当我尝试构建应用程序时,它抛出错误-你的项目需要一个更新版本的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
请问有谁可以帮我吗?
1条答案
按热度按时间vlju58qv1#
我也有同样的问题。我尝试了多种解决方案。没有一个工作。终于找到了解决办法。在android/build中复制并通过下面的代码。grad勒
并在android/gradle/wrapper/www. example中更改
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
www.example.com