Skip to content

newDsl Flutter Fix is shown alongside the "unsupported AGP version" error #193865

Closed

Description

@jesswrd

If a project uses an existing Android Gradle Plugin (AGP) version newer than Flutter supports, the Flutter Gradle Plugin fails the build with an error telling the user to downgrade AGP.

The Flutter tool also prints the android.newDsl Flutter Fix message for the same failure. That message tells the user to update Flutter or opt out of android.newDsl, while the Gradle error tells them to downgrade AGP. Seeing both at once suggests two separate problems, and the user can't tell which fix to apply.

$ flutter build apk

FAILURE: Build failed with an exception.

* Where:
Build file '/path/to/my_app/android/app/build.gradle.kts' line: 1

* What went wrong:
An exception occurred applying plugin request [id: 'dev.flutter.flutter-gradle-plugin']
> Failed to apply plugin 'dev.flutter.flutter-gradle-plugin'.
   > Error: Your project's Android Gradle Plugin version (9.3.1) is not yet supported. Flutter does not support Android Gradle Plugin 9, and support will be added in a future Flutter release. Please downgrade your Android Gradle Plugin version to a version below 9.0.0 to continue.
     Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check (unsupported; your build may fail).

     Potential fix: Your project's AGP version is typically defined in the plugins block of the `settings.gradle` file (/path/to/my_app/android/settings.gradle), by a plugin with the id of com.android.application. 
     If you don't see a plugins block, your project was likely created with an older template version. In this case it is most likely defined in the top-level build.gradle file (/path/to/my_app/android/build.gradle) by the following line in the dependencies block of the buildscript: "classpath 'com.android.tools.build:gradle:<version>'".

BUILD FAILED in 28s
Running Gradle task 'assembleRelease'...                           28.2s

┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Starting AGP 9+, only the new DSL interface will be read.                                                            │
│ This results in a build failure when applying the Flutter Gradle plugin at /path/to/my_app/android/app/build.gradle.kts. │
│                                                                                                                          │
│ To resolve this update flutter or opt out of `android.newDsl`.                                                           │
│ For instructions on how to opt out, see: https://developer.android.com/build/releases/agp-9-0-0-release-notes            │
│                                                                                                                          │
│ If you are not upgrading to AGP 9+, run `flutter analyze --suggestions` to check for incompatible dependencies.          │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1

Activity

  1. added
    P2Important issues not at the top of the work list
    team-androidOwned by Android platform team
    triaged-androidTriaged by Android platform team
    and removed
    P2Important issues not at the top of the work list
    team-androidOwned by Android platform team
    triaged-androidTriaged by Android platform team
    on Oct 5, 2026
  2. self-assigned this
    on Oct 5, 2026
  3. github-actions commented on Oct 21, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions