Short answer: Flutter 3.50 needs AGP 9.1.1+, Gradle 9.3.1+, Kotlin 2.4.10+ and Java 17 on Android, or the build stops. New projects use AGP 9.3.1, Gradle 9.5.0 and Kotlin 2.4.20. Upgrade in this order: run flutter upgrade, raise the three versions in android/settings.gradle.kts and gradle-wrapper.properties, keep android.builtInKotlin=false and android.newDsl=false in gradle.properties, then run dart fix --apply to move to material_ui imports. Most apps take half a day to a day, plus testing.
The Dart side is mostly automatic. Almost all the trouble is in the Android Gradle files, because Flutter 3.50 requires AGP 9. Every version below is from the Flutter 3.50.1 tool source and flutter create templates, not from memory.
What changes in Flutter 3.50
| Flutter 3.35 | Flutter 3.50 | |
|---|---|---|
| Android Gradle Plugin: build fails below / new projects | 8.1.1 / 8.9.1 | 9.1.1 / 9.3.1 |
| Gradle: build fails below / new projects | 8.3 / 8.12 | 9.3.1 / 9.5.0 |
| Kotlin Gradle plugin: build fails below / new projects | 1.8.10 / 2.1.0 | 2.4.10 / 2.4.20 |
| Java (JDK): build fails below | 11 | 17 |
compileSdk / targetSdk / minSdk (flutter.* values) |
36 / 36 / 24 | 36 / 36 / 24 |
| Material and Cupertino imports | package:flutter/material.dart |
package:material_ui/material_ui.dart (old one deprecated) |
| iOS deployment target in new projects | 13.0 | 15.0 |
Flutter also warns (without failing) below Gradle 9.5.0, AGP 9.3.1 and Kotlin 2.4.20, and stops the build if minSdk is below 23.
The two changes that catch people out:
- AGP 9 has built-in Kotlin. Flutter keeps it turned off with two
gradle.propertiesflags. If they’re missing, the build fails with “kotlin.android plugin is no longer required since AGP 9.0”. - Material moved to its own package. Since Flutter 3.47, Material widgets live in
material_uiand Cupertino incupertino_ui. Your code still compiles, butflutter analyzeshows a deprecation on nearly every file until you migrate.
Before you start
- Work on a new git branch, and commit before each step below. If a step breaks the build, you can see exactly what changed.
- Note your current version with
flutter --version. The older your current version, the more Gradle work to expect: the AGP 8 to 9 jump is the big one. - Check your packages first. Paste your
pubspec.yamlinto the Flutter package checker to see which ones are outdated or discontinued. An old plugin is the most common reason an upgrade stalls.
Step 1: upgrade Flutter and your packages
flutter channel stable
flutter upgrade
flutter --version # should say 3.50.x
flutter pub upgrade --major-versions
If you use FVM, run fvm install 3.50.1 and fvm use 3.50.1 instead. Then run flutter pub get and fix any version conflicts before you touch Gradle.
Step 2: raise AGP, Kotlin and Gradle
Open android/settings.gradle.kts (or settings.gradle) and change the versions in the plugins block. These are the values flutter create writes on 3.50:
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "9.3.1" apply false
id("org.jetbrains.kotlin.android") version "2.4.20" apply false
}
Then the Gradle wrapper, in android/gradle/wrapper/gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-all.zip
If your project has no plugins block in settings.gradle, it was created before Flutter 3.19 and still uses the old buildscript setup. Move it to the plugins block first; with AGP 9 the old setup isn’t worth patching.
Make sure Gradle runs on JDK 17. Check with flutter doctor -v, and if it’s wrong, point Flutter at the right JDK with flutter config --jdk-dir <path>. A JDK mismatch shows up as “Unsupported class file major version”.
Not sure what your files say now? Paste them into the Gradle and target API checker: it lists every version to change.
Step 3: keep built-in Kotlin off (for now)
Open android/gradle.properties and check these two lines are there:
android.builtInKotlin=false
android.newDsl=false
Flutter 3.50 adds them automatically the first time you run flutter run or flutter build. So run one Flutter build before you open the project in Android Studio. A Gradle sync in Android Studio, or ./gradlew, doesn’t run that migration, and then you get the built-in Kotlin error. The full explanation and the longer-term migration are in the AGP 9 built-in Kotlin fix.
Don’t set android.builtInKotlin=true yet unless every plugin in your app has migrated. One plugin that still applies kotlin-android brings the error back.
Step 4: update android/app/build.gradle.kts
Two things in the app module.
Kotlin options. The 3.50 template replaces the old kotlinOptions block inside android { } with a top-level kotlin { } block:
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
SDK versions. Use Flutter’s values unless you have a reason not to:
android {
compileSdk = flutter.compileSdkVersion // 36
defaultConfig {
minSdk = flutter.minSdkVersion // 24
targetSdk = flutter.targetSdkVersion // 36
}
}
targetSdk 36 is also what Google Play requires for new apps and updates: see the target API level guide. If you hardcode minSdk = 21, 3.50 stops the build: raise it to at least 23, ideally 24.
Then build:
flutter clean
flutter build apk --debug
Step 5: move to material_ui and cupertino_ui
dart fix --apply
flutter pub add material_ui cupertino_ui
flutter analyze
dart fix rewrites package:flutter/material.dart to package:material_ui/material_ui.dart (and the Cupertino import the same way) and adds the packages to pubspec.yaml. New 3.50 projects already depend on material_ui ^1.1.0. Details and edge cases are in the material_ui migration answer.
This step is optional for now: the old imports are deprecated, not removed. But do it in the same branch, because the analyzer noise otherwise hides real warnings.
Step 6: check iOS
iOS changes less in 3.50, but run it before you call the upgrade done:
cd ios
pod repo update
pod install
cd ..
flutter build ios --no-codesign
- Flutter recommends CocoaPods 1.16.2 or newer (
pod --version) and warns below it. - New projects set the iOS deployment target to 15.0. If a plugin now needs a higher target than your Podfile allows,
pod installfails: see the pod install fix.
Errors you may see, and the fix for each
| Error | Fix |
|---|---|
| “The ‘org.jetbrains.kotlin.android’ plugin is no longer required for Kotlin support since AGP 9.0” | Add the two gradle.properties flags |
| “Your project requires a newer version of the Kotlin Gradle plugin” | Raise Kotlin to 2.4.20 |
| “Unsupported class file major version” | Match JDK and Gradle |
checkDebugAarMetadata asks to compile against version 36 |
Raise compileSdk |
| “minSdkVersion cannot be smaller than” | Raise minSdk |
| “Namespace not specified” | Update or patch the old plugin |
java.lang.NullPointerException (no error message) while applying the Flutter Gradle plugin |
Put android.newDsl=false back in gradle.properties |
| “Error running pod install” | CocoaPods fixes |
How long does it take?
For a typical app with 15–30 packages: half a day to a day for the upgrade itself, then a round of testing on a real Android and iOS device. It takes longer when a plugin you depend on hasn’t been updated for AGP 8 or 9: then you either wait, fork it or replace it.
If you’d rather not do it yourself, keeping apps on current Flutter and store rules is part of my app maintenance service, and the maintenance checklist covers what to check every month.
Frequently asked questions
What Android Gradle Plugin version does Flutter 3.50 need?
Flutter 3.50 stops the build below AGP 9.1.1 and warns below 9.3.1. New 3.50 projects use AGP 9.3.1 with Gradle 9.5.0 and Kotlin 2.4.20, and Java 17 is required.
Do I have to migrate to material_ui when I upgrade to Flutter 3.50?
Not immediately. package:flutter/material.dart is deprecated but still works. Running dart fix –apply migrates the imports and adds material_ui and cupertino_ui to pubspec.yaml, so it’s worth doing in the same upgrade.
Why does my Flutter 3.50 project fail in Android Studio but build with flutter run?
flutter run and flutter build add android.builtInKotlin=false and android.newDsl=false to android/gradle.properties. A Gradle sync in Android Studio doesn’t, so AGP 9 turns built-in Kotlin on and the kotlin-android plugin fails. Run one Flutter build first, or add the two lines yourself.
What minSdk does Flutter 3.50 support?
flutter.minSdkVersion is 24 (Android 7.0). Flutter 3.50 stops the build if minSdk is below 23 and warns below 24. compileSdk and targetSdk are both 36.
Can I skip from Flutter 3.27 straight to 3.50?
Yes. Flutter upgrades don’t need to go one release at a time. The Android Gradle setup is the main work: move to the plugins block in settings.gradle if you haven’t, then raise AGP, Gradle and Kotlin straight to the 3.50 versions.
Need a Flutter app built? Tell me about your project, or see case studies of apps I’ve worked on.
