Key takeaways
- AGP 9.0 changes two defaults: android.builtInKotlin goes from false to true, and android.newDsl goes from false to true. Google says the org.jetbrains.kotlin.android plugin is not compatible with the new DSL and must be removed.
- AGP 9.0 needs at least Gradle 9.1.0, JDK 17 and SDK Build Tools 36.0.0, and it has a runtime dependency on Kotlin Gradle plugin 2.2.10.
- Flutter 3.44.0 (May 18, 2026) added AGP 9 support with built-in Kotlin turned off. Setting android.builtInKotlin=true needs Flutter 3.47 or later, and 3.47.0 came out on August 12, 2026.
- Flutter's own tracking issue for full AGP 9 support was still open on October 18, 2026. Plugins that still apply kotlin-android can block your build, even when your app is migrated.
- The safe path is to add android.builtInKotlin=false and android.newDsl=false to android/gradle.properties, get the build green, then migrate the app and its plugins and turn the flags on.
Pricing an app? Try the free app cost calculator or get a range for your project in the instant quote.
If a Flutter Android build fails after you move to Android Gradle Plugin 9, the cause is usually built-in Kotlin: AGP 9.0 turns it on by default, and a project or plugin that still applies kotlin-android breaks. The quick fix is two flags in android/gradle.properties. The lasting fix is to migrate the app and its plugins. Flutter 3.44 or later is needed for AGP 9, and 3.47 or later to switch built-in Kotlin on.
The facts below come from Google's AGP 9.0 release notes, Flutter's migration guides and Flutter's GitHub issues, as listed in the sources. I checked each one on October 18, 2026.
Disclosure: App369 is my studio. I build and fix Flutter apps, and the last section mentions what I sell. Google doesn't pay me for anything on this page.
What AGP 9.0 changes
Google's release notes list a major release with API and behavior changes. The ones that matter for a Flutter app:
| Item | AGP 9.0 |
|---|---|
| Minimum Gradle | 9.1.0 |
| Minimum JDK | 17 |
| SDK Build Tools | 36.0.0 |
| Kotlin Gradle plugin | Runtime dependency on 2.2.10. A lower version is upgraded automatically |
android.builtInKotlin | Default changes from false to true |
android.newDsl | Default changes from false to true |
Source for the table: AGP 9.0.1 release notes.
Google's notes say you no longer apply org.jetbrains.kotlin.android or kotlin-android to compile Kotlin, and that the plugin is not compatible with the new DSL. With the new DSL on, the legacy BaseExtension and the old variant API, such as applicationVariants, are removed. Google also lists changed defaults for other android.* properties, including android.useAndroidx, android.uniquePackageNames and android.r8.strictFullModeForKeepRules. Check the full list in the notes if you set any of them.
The error you will see
Flutter's issue #181383 shows this output from a plugin (camera_android_camerax 0.6.27) that still applies the Kotlin plugin under AGP 9.0. The first line and the explanation read:
Failed to apply plugin 'kotlin-android'.
The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0.
The same issue shows Flutter's own message for your app's Gradle file, starting with "Starting AGP 9+, the default has become built-in Kotlin. This results in a build failure when applying the kotlin-android plugin at" followed by the path of the file.
Flutter's docs say the same in plain terms: apps that use the kotlin-android plugin fail to build without migration.
Where Flutter stands
| Date | What happened | Source |
|---|---|---|
| January 27, 2026 | Flutter opens its tracking issue "Flutter Fully Supports AGP 9" | Flutter issue #181557 |
| May 18, 2026 | Flutter 3.44.0: AGP 9 support with built-in Kotlin disabled | Flutter docs, release archive |
| August 12, 2026 | Flutter 3.47.0: android.builtInKotlin=true is supported | Flutter docs, release archive |
The tracking issue says Flutter found that all plugins in an Android project must also migrate to built-in Kotlin to avoid build failures. Because AGP 9 had already launched, Flutter says it advised developers against adopting AGP 9 until it could support all migration states. The issue was still open on October 18, 2026, with some work items unchecked.
The fix
These steps follow Flutter's guide for app developers. My advice: commit your work first, and change one thing at a time so you know which step fixed the build.
1. Upgrade Flutter
Use Flutter 3.44 or later. Flutter's docs say 3.44 added AGP 9 support with built-in Kotlin disabled. If you want to turn built-in Kotlin on, you need 3.47 or later.
2. Get the build working with the opt-out flags
Flutter's guide says the app should have these two flags in android/gradle.properties:
android.builtInKotlin=false
android.newDsl=false
Flutter's migrator adds them on the next flutter run or flutter build apk, or when you build from Android Studio. Add-to-app host apps must add both flags by hand to the host project's gradle.properties, because the migrator can't run during native host builds.
Issue #191703 is an add-to-app report on Flutter 3.47.1 with AGP 9.2.1 and Gradle 9.6.1. The reporter hit a NullPointerException in getLegacyAndroidExtension with the AGP 9 defaults, and says setting both flags to false fixed it. That issue was still open when I checked.
3. Migrate the app to built-in Kotlin
This applies only if your app already applies the Kotlin Gradle plugin, and only on Flutter 3.47 or later. If your app doesn't apply it, Flutter's guide says android.newDsl=false is all you need, so stop here. Do this step together with step 5, because with android.builtInKotlin=false the app still needs kotlin-android to compile Kotlin. On Flutter 3.44 to 3.46, stop after step 2. In android/app/build.gradle or build.gradle.kts, Flutter's guide says to remove the kotlin-android plugin and the kotlinOptions block, then add a kotlin block:
plugins {
id("com.android.application")
// ...
}
android {
// ...
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
The guide has the same change for the older Groovy apply plugin syntax and for add-to-app host apps that use alias(libs.plugins.kotlin.android).
4. Check your plugins
Your plugins matter just as much as your own Gradle files. Flutter's guide says that if a build fails because a plugin has not migrated, you should check its changelog on pub.dev and file an issue titled "Migrate plugin to built-in Kotlin" with the plugin's authors. The guide links a separate migration guide for plugin authors.
5. Turn built-in Kotlin on
Once the app and its plugins are migrated, Flutter's guide says to set this in android/gradle.properties, on Flutter 3.47 or later, in the same change as step 3:
android.builtInKotlin=true
Then run flutter run or flutter build apk and confirm the app builds and launches.
About the AGP Upgrade Assistant
Android Studio has a tool under Tools > AGP Upgrade Assistant. Google says it translates build files for a newer AGP, checks AGP and Gradle compatibility, and checks third-party Gradle plugin versions. Google also says it relies on static analysis, doesn't support some setups such as Gradle Version Catalogs defined in settings files, and might still fail to perform a clean upgrade. In a Flutter project, my advice: use it on the android folder only as a starting point, and test with flutter build afterward.
If the build still fails after this
Flutter's docs say it will remove support for applying the Kotlin Gradle plugin in a future version, and later remove support for the old AGP DSL. Google's notes say the new DSL opt-out will be removed in AGP 10.0. So I'd treat the two false flags as a temporary bridge, not a fix.
If your error is about apply from: flutter.gradle, see the imperative apply fix. If it names the v1 embedding, see the v1 embedding guide. If Play Console flags page sizes after you update Android tooling, see the 16 KB guide.
Need a hand?
If your Flutter Android build still fails after the AGP upgrade, the App Fix Ticket covers it in two fixed-price steps. A $450 Diagnosis gives you the root cause with evidence and a fixed repair quote within 3 business days, credited toward the fix. If you go ahead, the $1,200 Fix takes 5 business days and comes as a pull request. Or send me a short description.
Frequently asked questions
- Why does my Flutter Android build fail after upgrading to AGP 9?
- AGP 9.0 turns built-in Kotlin on by default. A project that still applies kotlin-android or org.jetbrains.kotlin.android hits a build failure. Flutter's docs say apps that use the kotlin-android plugin fail to build without migration, or without the opt-out flags.
- Which Flutter version supports AGP 9?
- Flutter's docs say Flutter 3.44 added AGP 9 support with built-in Kotlin disabled, and that setting android.builtInKotlin=true requires Flutter 3.47 or later. The release archive dates 3.44.0 May 18, 2026 and 3.47.0 August 12, 2026.
- What are the quick flags to get a build working again?
- Flutter's migration guide for app developers lists android.builtInKotlin=false and android.newDsl=false in android/gradle.properties. Flutter's migrator adds them on the next flutter run or flutter build apk. Add-to-app host apps must add them by hand.
- Do I have to migrate to built-in Kotlin?
- Flutter recommends it. Its docs say Flutter will remove support for applying the Kotlin Gradle plugin in a future version, and that it will later remove support for the old AGP DSL. Google says the ability to opt out of the new DSL will be removed in AGP 10.0.
- Can the AGP Upgrade Assistant fix this for me?
- It can help with build file syntax and version compatibility, from Tools > AGP Upgrade Assistant in Android Studio. Google says it relies on static analysis and might still fail to perform a clean upgrade, so commit your work first and build and test afterward.
Sources
- Android Developers, Android Gradle plugin 9.0.1 release notes (page last updated October 16, 2026)
- Android Developers, Android Gradle plugin Upgrade Assistant
- Flutter docs, Migrating Flutter Android projects to built-in Kotlin (last updated August 20, 2026)
- Flutter docs, Built-in Kotlin migration for app developers (last updated August 20, 2026)
- Flutter on GitHub, issue #181557 "Flutter Fully Supports AGP 9"
- Flutter on GitHub, issue #181383 "[many] Flutter maintained plugins should support AGP 9.0"
- Flutter on GitHub, issue #191703 "[add-to-app] FGP throws NPE in getLegacyAndroidExtension when the host app builds with AGP 9 defaults (newDsl)"
- Flutter release archive (macOS)
Fixed-price services
Want this done at a fixed price?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
Related Resources
Related guides
Flutter "Applying Gradle Plugin Imperatively" Error: The Fix
Since Flutter 3.29 (February 12, 2025), an Android build that still uses apply from: flutter.gradle fails with "You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is not possible anymore." How to move settings.gradle, build.gradle and app/build.gradle to the plugins {} block, from Flutter's docs and source checked October 18, 2026.
Read moreFlutter "Deleted Android v1 Embedding" Build Error: The Fix
Flutter removed the Android v1 embedding in Flutter 3.29 (February 12, 2025), so older projects now stop with "Build failed due to use of deleted Android v1 embedding" or a plugin error about PluginRegistry.Registrar. What the error means, how Flutter decides your app is v1, and the exact AndroidManifest and MainActivity changes, from Flutter's docs and source checked October 18, 2026.
Read moreGoogle Play 16 KB Page Size: Fixing Flutter and Android Apps
Google Play requires apps targeting Android 15 and higher to support 16 KB memory page sizes on 64-bit devices, and Google says that from February 1, 2027 updates without it can't be released. How to check an APK, the AGP and NDK versions that fix it, and why Flutter 3.38 matters, from Google's and Flutter's docs checked October 18, 2026.
Read more