Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm already using Kotlin latest version still Flutter wants me to upgrade

When I run the emulator I get these errors and fix :

e: file:///C:/Users/xunre/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.1.10/d3028429e7151d7a7c1a0d63a4f60eac86a87b91/kotlin-stdlib-2.1.10.jar!/META-INF/kotlin-stdlib.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.8.0. 
BUILD FAILED in 21m 7s
Running Gradle task 'assembleRelease'...                         1268.7s

┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────────────┐        
│ [!] Your project requires a newer version of the Kotlin BUILD FAILED in 21m 7s
Running Gradle task 'assembleRelease'...                         1268.7s

┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] 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            │
│ C:\flutte projects\unfinished\red_heart\android\settings.gradle.                                       │
│                                                                                                        │
│ Alternatively (if your project was created before Flutter 3.19), update                                │
│ C:\flutte projects\unfinished\red_heart\android\build.gradle                                           │
│ ext.kotlin_version = '<latest-version>'                                                                │
└──────────────────────────────────────────────────────────────────────────────────────────

My android android\settings.gradle(already latest kotlin version "2.1.10"):

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.1.0" apply false
    id "org.jetbrains.kotlin.android" version "2.1.10" apply false
}

I have upgraded plugins with Gradle's declarative plugins {} block.

The app is running fine on the emulator and I got this error when I did the flutter build apk. This is a project 2 years ago I had to do a lot of fix for it to get running. so my question is when it runs on an emulator why did the build failed?

like image 210
unrealt3n Avatar asked Nov 17 '25 06:11

unrealt3n


1 Answers

if jdk version is not compatible with gradle version then it shows error, check with jdk and gradle version.

Here check compatibility, Hope so this will resolve your issue.

like image 187
WhisperingWinds Avatar answered Nov 18 '25 19:11

WhisperingWinds



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!