skip to Main Content

I upgraded the SDK to Flutter version 3.24 yesterday, but today I’m encountering an error when trying to launch the app. I added the new version of Kotlin and changed the kotlin-stdlib-jdk7 version, but the result didn’t change. Do you have any suggestions for a solution?

Error messages:

AAPT: error: resource android:attr/lStar not found.

Your project requires a newer version of the Kotlin Gradle plugin. Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update the version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of path

settings

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.2.2" apply false
    id "org.jetbrains.kotlin.android" version "1.9.25" apply false
    id "com.google.gms.google-services" version "4.3.15" apply false
}

app/gradle

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.22"
    implementation 'com.google.android.gms:play-services-location:21.1.0'
    implementation "org.jetbrains.kotlin:kotlin-script-runtime:1.9.0"
    implementation 'com.android.support:multidex:2.0.1'
}

configurations.all {
    resolutionStrategy {
        eachDependency {
            if ((requested.group == "org.jetbrains.kotlin")
                    &&(requested.name.startsWith("kotlin-stdlib"))) {
                useVersion("2.0.10")
            }
        }
    }
}

2

Answers


  1. Chosen as BEST ANSWER

    I solved it by downgrading the version to 3.22.2. It's not a complete solution.

    flutter downgrade 3.22.2
    

    Those who did not have problems with the previous version can use it.


  2. update the kotlin version and update the distributionUrl into correct version that can be reliable to your kotlin version distributionUrl=> android=>grale=>gradle-wrapper.properties

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search