I've recently upgraded my Flutter version to the newest one (3.27.1). Everything works fine when I run the app directly through IDE. But when I tried to build my app's APK for deployment, it doesn't work. This is the error that I've been getting.
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 │
│ <the location of my settings.gradle> │
│ │
│ Alternatively (if your project was created before Flutter 3.19), update │
│ <the location of my build.gradle> │
│ ext.kotlin_version = '<latest-version>'
For my case, my project was created before Flutter 3.19, so I followed the latter option. My initial kotlin_version is 1.9.0. I changed the ext.kotlin_version to 2.1.0 (The current newest version). It then tells me to upgrade my gradle version as well, so I did. But after all that, the same error appeared telling me to upgrade my kotlin version. I tried downgrading to 1.9.22 as well but still it didn't work.
Any help would be greatly appreciated. Thanks.
After upgrading flutter version its want to sdk also update pubsec yaml sdk: ^3.6.0
take backup your android,ios folder then delete that
flutter create . (it will generate your android ,ios ,web and others as well)
check your manifest file it will comes as its then run if its shows error midsdk 34 like change as per your project need it will solve issues
sometimes the app size will big.
ANOTHER WAY: If your working local projects create new project copy paste your lib folder to new project same as well add your pubspecyaml also. It is simple way to solve issues.
for jan 11 2025 go to android > build.gradle and update ext.kotlin_version like below
buildscript { ext.kotlin_version = '1.8.22' //only change this line
repositor.... //here do not touch'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With