Skip to content

[AGP 9] Update AGP Error#185043

Merged
auto-submit[bot] merged 1 commit intoflutter:masterfrom
jesswrd:agp-usable
Apr 15, 2026
Merged

[AGP 9] Update AGP Error#185043
auto-submit[bot] merged 1 commit intoflutter:masterfrom
jesswrd:agp-usable

Conversation

@jesswrd
Copy link
Copy Markdown
Contributor

@jesswrd jesswrd commented Apr 14, 2026

AGP is ready to use. Developers should not be running into this error at all due to support that has been added for Built-in Kotlin #184836. But in the event that they do run into this error, they will be guided to the right docs.

Fixes #186097

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@jesswrd jesswrd requested a review from a team as a code owner April 14, 2026 18:13
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Apr 14, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Apr 14, 2026
Copy link
Copy Markdown
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Developers should not be running into this error at all due to . " Due to what?

@reidbaker
Copy link
Copy Markdown
Contributor

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the generic AGP 9 warning with specific documentation URLs and updated error messages in gradle_errors.dart, while updating the corresponding test suite. Feedback suggests restoring the file path in the Kotlin migration error message for consistency, correcting grammar and capitalization in the DSL opt-out message, and fixing a spacing mismatch in the test expectations to prevent test failures.

Comment thread packages/flutter_tools/lib/src/android/gradle_errors.dart
Comment thread packages/flutter_tools/lib/src/android/gradle_errors.dart
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates AGP 9 migration error messages in the Flutter tools by replacing a generic warning constant with specific documentation URLs for built-in Kotlin migration and new DSL opt-out. The review feedback suggests restoring the Gradle file path in the Kotlin plugin error message to maintain consistency and provide better context for developers. Additionally, there are suggestions to correct capitalization and punctuation in the DSL error message and to fix a leading space in a test expectation that would otherwise cause a test failure.

Comment thread packages/flutter_tools/lib/src/android/gradle_errors.dart
Comment thread packages/flutter_tools/lib/src/android/gradle_errors.dart
@jesswrd
Copy link
Copy Markdown
Contributor Author

jesswrd commented Apr 14, 2026

"Developers should not be running into this error at all due to . " Due to what?

done added link.

@jesswrd jesswrd added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 14, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 14, 2026
Merged via the queue into flutter:master with commit 85d5706 Apr 15, 2026
158 of 159 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 15, 2026
master-wayne7 pushed a commit to master-wayne7/flutter that referenced this pull request Apr 15, 2026
AGP is ready to use. Developers should not be running into this error at
all due to support that has been added for Built-in Kotlin
flutter#184836. But in the event that
they do run into this error, they will be guided to the right docs.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 16, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 16, 2026
Roll Flutter from c1b14e92dcfb to 31f1802cb859 (46 revisions)

flutter/flutter@c1b14e9...31f1802

2026-04-16 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (#185083)" (flutter/flutter#185145)
2026-04-16 evanwall@buffalo.edu Add oval drawing support to the SDF uber shader (flutter/flutter#184903)
2026-04-16 okorohelijah@google.com Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (flutter/flutter#185083)
2026-04-16 engine-flutter-autoroll@skia.org Roll Skia from 2c49b3f9c3c2 to 391cdbe3ffe9 (2 revisions) (flutter/flutter#185138)
2026-04-16 engine-flutter-autoroll@skia.org Roll Dart SDK from 4ee990654146 to fbddcbe0cd96 (1 revision) (flutter/flutter#185137)
2026-04-16 engine-flutter-autoroll@skia.org Roll Skia from f4e3cd2c2159 to 2c49b3f9c3c2 (14 revisions) (flutter/flutter#185131)
2026-04-16 engine-flutter-autoroll@skia.org Roll Dart SDK from 87b7c87e7207 to 4ee990654146 (5 revisions) (flutter/flutter#185108)
2026-04-15 jacksongardner@google.com Use the `flutteractionsbot` token to push the release branch. (flutter/flutter#184833)
2026-04-15 63195100+tjoengCRC@users.noreply.github.com Allow period characters in iOS and macOS framework names (flutter/flutter#184335)
2026-04-15 zemanux@users.noreply.github.com Fix SliverResizingHeader semantic focus (flutter/flutter#179690)
2026-04-15 srawlins@google.com ignore avoid_type_to_string lint rule in flutter_tools (flutter/flutter#184766)
2026-04-15 engine-flutter-autoroll@skia.org Roll Skia from bda7232e6772 to f4e3cd2c2159 (4 revisions) (flutter/flutter#185063)
2026-04-15 stuartmorgan@google.com Add initial AI guidance for issues (flutter/flutter#184885)
2026-04-15 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from rB8LAuZL_DwHMssTU... to IdBT8fSMYrYSip65j... (flutter/flutter#185064)
2026-04-15 jason-simmons@users.noreply.github.com Fix an ordering dependency in the services/system_chrome_test.dart test suite (flutter/flutter#185086)
2026-04-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[ios][platform_view]Reland hitTest approach (with a few 2026 update) (#183484)" (flutter/flutter#185082)
2026-04-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (#179810)" (flutter/flutter#185067)
2026-04-15 dacoharkes@google.com Agent rule: Dart editing (flutter/flutter#185045)
2026-04-15 41930132+hellohuanlin@users.noreply.github.com [ios][platform_view]Reland hitTest approach (with a few 2026 update) (flutter/flutter#183484)
2026-04-15 okorohelijah@google.com Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (flutter/flutter#179810)
2026-04-15 engine-flutter-autoroll@skia.org Roll Dart SDK from ee5afcef0596 to 87b7c87e7207 (4 revisions) (flutter/flutter#185060)
2026-04-15 engine-flutter-autoroll@skia.org Roll Skia from 4c382df6a25a to bda7232e6772 (7 revisions) (flutter/flutter#185057)
2026-04-15 brackenavaron@gmail.com Remove material import from toggleable_test.dart + draggable_test.dart + obscured_animated_image_test.dart + sliver_constraints_test.dart (flutter/flutter#181774)
2026-04-15 120367427+master-wayne7@users.noreply.github.com refactor: Remove material imports from Widget tests  (flutter/flutter#184877)
2026-04-14 52160996+FMorschel@users.noreply.github.com Adds missing `await`s on forgotten cases (flutter/flutter#183466)
2026-04-14 srawlins@google.com Use an if-element in a collection literal instead of a conditional expression (flutter/flutter#184830)
2026-04-14 50643541+Mairramer@users.noreply.github.com update popular issues documentation (flutter/flutter#183196)
2026-04-14 43054281+camsim99@users.noreply.github.com [Android] Add integration test for setting engine flags via the manifest (flutter/flutter#182241)
2026-04-14 rmacnak@google.com [fuchsia] Ask for both ambient-replace and VMEX to allow for a softer transition. (flutter/flutter#185042)
2026-04-14 goderbauer@google.com Make `multiple_windows` follow repo analyzer rules (flutter/flutter#184753)
2026-04-14 58529443+srujzs@users.noreply.github.com Ignore incoming deprecated_web_configuration lint (flutter/flutter#184130)
2026-04-14 jesswon@google.com [AGP 9] Update AGP Error (flutter/flutter#185043)
2026-04-14 magder@google.com Move widget_preview_scaffold into pub workspace (flutter/flutter#182627)
2026-04-14 planetmarshall@users.noreply.github.com Fix gles interactive tests (flutter/flutter#181389)
2026-04-14 katelovett@google.com Update customer tests.version (flutter/flutter#185044)
2026-04-14 mdebbar@google.com [SKILL] upgrade-browser (flutter/flutter#184894)
2026-04-14 dacoharkes@google.com [ci] Split up integration.shard dart_data_asset_test.dart (flutter/flutter#185021)
2026-04-14 mr-peipei@web.de Hold startup lock until after `pub get` to prevent races (flutter/flutter#184294)
2026-04-14 6226493+andeart@users.noreply.github.com Add `--include-example` flag to `flutter clean` for package example projects (flutter/flutter#183455)
2026-04-14 15619084+vashworth@users.noreply.github.com Disable multi-pack-index when calling flutter from Xcode (flutter/flutter#184998)
2026-04-14 42123156+nvi9@users.noreply.github.com Fix icon tree shaking when building for desktop (flutter/flutter#184249)
2026-04-14 15619084+vashworth@users.noreply.github.com Fix killing wrong xcrun command (flutter/flutter#184831)
2026-04-14 alex.medinsh@gmail.com Allow Xcode build configuration to not contain flavor name (flutter/flutter#183398)
2026-04-14 mdebbar@google.com [web] Async rendering for benchmarks (flutter/flutter#184677)
2026-04-14 dacoharkes@google.com [ci] Split up integration.shard native_assets_test.dart (flutter/flutter#185020)
2026-04-14 737941+loic-sharma@users.noreply.github.com Skip flutter widget-preview test that times out frequently (flutter/flutter#184988)
...
@jesswrd jesswrd added cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch labels Apr 30, 2026
@flutteractionsbot
Copy link
Copy Markdown
Contributor

Failed to create CP due to merge conflicts.
You will need to create the PR manually. See the cherrypick wiki for more info.

auto-submit Bot pushed a commit that referenced this pull request May 6, 2026
AGP is ready to use. Developers should not be running into this error at all due to support that has been added for Built-in Kotlin #184836. But in the event that they do run into this error, they will be guided to the right docs: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin.

**Issue Link:**
What is the link to the issue this cherry-pick is addressing?

#186097

**Impacted Users:** Flutter Android devs who have updated to AGP 9+ and are applying the Kotlin Gradle Plugin. Users only see this error message if they still somehow receive the android provided error message even after we added support for both Built-in Kotlin and KGP.

**Impact Description:** To communicate AGP is ready to use and to add useful [Flutter docs for migration to Built-in Kotlin](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin).

**Changelog Description:**
[flutter/186097](#186097): For Flutter apps on AGP 9+ and opted-in to built-in Kotlin without proper migration and the Flutter support for both Built-in Kotlin and KGP fails [here](#184836), we will provide a Flutter error message.

Workaround: Updating error message so N/A

**Risk:** Very low risk
**Test Coverage:** yes confident
**Validation Steps:** unit tests or trigger the Android provided error (highly unlikely given we added support)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AGP 9] Update AGP 9 Error

3 participants