# Flutter Android Build Fails After AGP 9: The Fix

> Flutter AGP 9 build failed? AGP 9 turns on built-in Kotlin, so kotlin-android can break. The Flutter versions and Gradle fixes, from docs checked Oct 21, 2026.

Canonical: https://app369.com/blog/flutter-android-gradle-plugin-9-build-failed-fix-2026/
Last updated: 2026-10-21

[![Simon Dziak](https://app369.com/.netlify/images?w=48&amp;h=48&amp;fm=webp&amp;q=100&amp;url=%2Fimages%2Fszymon.jpg) **Simon Dziak** Founder & developer, App369](https://app369.com/about/szymon-dziak/) [LinkedIn](https://www.linkedin.com/in/szymondziak/)

Published October 18, 2026 · Updated October 21, 2026•Facts last verified October 21, 2026•7 min

App369https://app369.com/blog/flutter-android-gradle-plugin-9-build-failed-fix-2026/

[← Back to Blog](https://app369.com/blog/)

## 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 21, 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](https://app369.com/tools/app-cost-calculator/) or get a range for your project in the [instant quote](https://app369.com/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 21, 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](https://developer.android.com/build/releases/agp-9-0-0-release-notes). These are the AGP 9.0 minimums. Later 9.x releases raise them: Google’s notes for AGP 9.4.0 (September 2026) list Gradle 9.6.0 as the minimum, with JDK 17 and SDK Build Tools 36.0.0 unchanged.

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](https://github.com/flutter/flutter/issues/181557) |
| **May 18, 2026** | **Flutter 3.44.0: AGP 9 support with built-in Kotlin disabled** | [Flutter docs](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin), [release archive](https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json) |
| **August 12, 2026** | **Flutter 3.47.0: `android.builtInKotlin=true` is supported** | [Flutter docs](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin), [release archive](https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json) |

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 21, 2026, with some work items unchecked.

## The fix

These steps follow Flutter’s [guide for app developers](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/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 on October 21, 2026. A commenter reports the error is gone on Flutter 3.50.0-0.1.pre (beta), which carries the fix from PR #192116, and says the issue can close once the fix reaches stable.

### 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 Flutter’s guide has you turn built-in Kotlin on right after this edit. 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](https://app369.com/blog/flutter-gradle-plugin-applied-imperatively-fix-2026/). If it says “Unsupported class file major version”, see [matching Java and Gradle](https://app369.com/fix/flutter-unsupported-class-file-major-version/). If it names the v1 embedding, see [the v1 embedding guide](https://app369.com/blog/flutter-deleted-android-v1-embedding-build-failed-2026/). If Play Console flags page sizes after you update Android tooling, see [the 16 KB guide](https://app369.com/blog/google-play-16kb-page-size-flutter-android-2026/). Once the build passes, the free [Google Play deadline checker](https://app369.com/tools/google-play-deadline-checker/) reads your Gradle files and flags the target API, AGP and NDK versions Google Play needs next.

## Need a hand?

If your Flutter Android build still fails after the AGP upgrade, the [App Fix Ticket](https://app369.com/fixed-price/flutter-firebase-bug-fix/) 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](https://app369.com/contact/).

## **Want this done at a fixed price?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [**App Fix Ticket**from $450One reproducible bug in an existing mobile or web app, diagnosed and fixed.](https://app369.com/fixed-price/flutter-firebase-bug-fix/)

## **Frequently asked questions**

<dl>

<dt>**Why does my Flutter Android build fail after upgrading to AGP 9?**</dt>
<dd>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.</dd>

<dt>**Which Flutter version supports AGP 9?**</dt>
<dd>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.</dd>

<dt>**What are the quick flags to get a build working again?**</dt>
<dd>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.</dd>

<dt>**Do I have to migrate to built-in Kotlin?**</dt>
<dd>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.</dd>

<dt>**Can the AGP Upgrade Assistant fix this for me?**</dt>
<dd>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.</dd>

</dl>

## **Sources**

1. [Android Developers, Android Gradle plugin 9.0.1 release notes (page last updated October 16, 2026)](https://developer.android.com/build/releases/agp-9-0-0-release-notes)
2. [Android Developers, Android Gradle plugin Upgrade Assistant](https://developer.android.com/build/agp-upgrade-assistant)
3. [Flutter docs, Migrating Flutter Android projects to built-in Kotlin (last updated August 20, 2026)](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin)
4. [Flutter docs, Built-in Kotlin migration for app developers (last updated August 20, 2026)](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers)
5. [Flutter on GitHub, issue #181557 "Flutter Fully Supports AGP 9"](https://github.com/flutter/flutter/issues/181557)
6. [Flutter on GitHub, issue #181383 "\[many\] Flutter maintained plugins should support AGP 9.0"](https://github.com/flutter/flutter/issues/181383)
7. [Flutter on GitHub, issue #191703 "\[add-to-app\] FGP throws NPE in getLegacyAndroidExtension when the host app builds with AGP 9 defaults (newDsl)"](https://github.com/flutter/flutter/issues/191703)
8. [Flutter release archive (macOS)](https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json)
9. [Android Developers, Android Gradle plugin 9.4.0 release notes (September 2026)](https://developer.android.com/build/releases/agp-9-4-0-release-notes)

Tags

#flutter agp 9 build failed #android gradle plugin 9 flutter #kotlin-android plugin no longer required agp 9 #android.builtInKotlin #android.newDsl false #flutter built-in kotlin migration #flutter 3.44 agp 9 #flutter 3.47 builtinkotlin #agp upgrade assistant flutter #flutter plugin failed to apply plugin kotlin-android

Generated from app369.com . © 2026 App369. All rights reserved.

**Share:**

[Share on Twitter](https://twitter.com/intent/tweet?text=Flutter%20Android%20Build%20Fails%20After%20AGP%209%3A%20The%20Fix&amp;url=https%3A%2F%2Fapp369.com%2Fblog%2Fflutter-android-gradle-plugin-9-build-failed-fix-2026%2F) [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fapp369.com%2Fblog%2Fflutter-android-gradle-plugin-9-build-failed-fix-2026%2F) [Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fapp369.com%2Fblog%2Fflutter-android-gradle-plugin-9-build-failed-fix-2026%2F)

## **Related Resources **

[Flutter iOS Build Failed After an Upgrade? Fix CocoaPods and Xcode Errors (2026)](https://app369.com/blog/flutter-ios-build-failed-after-upgrade-2026/) [Flutter "Applying Gradle Plugin Imperatively" Error: The Fix](https://app369.com/blog/flutter-gradle-plugin-applied-imperatively-fix-2026/) [Flutter "Deleted Android v1 Embedding" Build Error: The Fix](https://app369.com/blog/flutter-deleted-android-v1-embedding-build-failed-2026/) [Expo and Flutter Build Errors: 12 Fixes (2026)](https://app369.com/blog/expo-flutter-build-errors-fixes-2026/) [JCenter Shutdown: Fixing Old Android and Flutter Builds](https://app369.com/blog/jcenter-bintray-shut-down-fix-android-flutter-builds-2026/) [ITMS-90725 SDK Version Issue: Fix in Flutter (Xcode 26)](https://app369.com/blog/itms-90725-sdk-version-issue-xcode-26-flutter-2026/)

## **Related guides **

[<h3>**Flutter "Applying Gradle Plugin Imperatively" Error: The Fix**</h3>Applying Flutter's main Gradle plugin imperatively fails since Flutter 3.29. How to move to the plugins {} block, from Flutter docs checked Oct 21, 2026.**Read more **](https://app369.com/blog/flutter-gradle-plugin-applied-imperatively-fix-2026/) [<h3>**Flutter "Deleted Android v1 Embedding" Build Error: The Fix**</h3>Build failed due to use of deleted Android v1 embedding? Flutter 3.29 removed v1. The AndroidManifest and MainActivity fixes, from docs checked Oct 21, 2026.** Read more **](https://app369.com/blog/flutter-deleted-android-v1-embedding-build-failed-2026/) [<h3>**Google Play 16 KB Page Size: Fixing Flutter and Android Apps**</h3>16 KB page size: Google Play needs it for apps targeting Android 15+ and blocks updates without it from Feb 1, 2027. How to check and fix, checked Oct 21, 2026.** Read more **](https://app369.com/blog/google-play-16kb-page-size-flutter-android-2026/)