添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, as title describes to updrage my kotlin version iam not getting in which file to upgrade my kotlin version. tried sevral methods by updating version but didnt work any so please say me where i need to increase my org.jetbrains.kotlin:kotlin-gradle-plugin version. below are my build.gradle file and app/build.gradle file from vscode, please go through it and say the what need to be done.

===============
build.gradle

allprojects {
repositories {
google()
mavenCentral()

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

tasks.register("clean", Delete) {
delete rootProject.buildDir

=================

app/build.gradle file

plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'

android {
namespace "com.example.ambuvians"
compileSdk 34
ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
kotlinOptions {
    jvmTarget = '1.8'
sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.ambuvians"
    // You can update the following values to match your application needs.
    // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
    minSdkVersion 21
    targetSdkVersion 34
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug

flutter {
source '../..'

dependencies {
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
implementation 'com.mapbox.maps:android:11.2.2'
please what would be the issue please let me know

To make sure your .gradle files are in the appropriate format, you can refer to:

  • Add documentation for migrating Android build files to declarative form flutter/flutter#135392
  • Your project requires a newer version of the Kotlin Gradle plugin flutter/flutter#137886 (comment)
  • This project's example app
  • having the same issue in location: ^6.0.1
    I have added the below code to my build.gradle file

    buildscript {
    ext.kotlin_version = '1.9.23'
    repositories {
        google()
        mavenCentral()
       dependencies {
           classpath 'com.android.tools.build:gradle:8.3.1'
           classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    

    and update the distribution URL to this
    distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

    still getting the same error to update the kotlin version

    dependencies {
        classpath 'com.android.tools.build:gradle:8.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    

    I got an error

    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ': location' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20