[AGP 9] Ensure Warnings Do Not Log When AGP Is Below 9#188373
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces logic to fetch the Android Gradle Plugin (AGP) version and skip logging Kotlin Gradle Plugin warnings if the AGP version is null or less than 9, along with corresponding unit tests. The reviewer points out that fetching the AGP version during the configuration phase is unreliable and suggests moving this check inside the projectsEvaluated block. Additionally, the reviewer notes that some of the newly added test mocks in FlutterPluginTest.kt will become redundant and should be removed if this change is implemented.
11 tasks
…stubbed in FlutterPluginTest as applying FGP happens much earlier in lifecycle
update to all projects have been evaluated
reidbaker
requested changes
Jun 23, 2026
11 tasks
… createMockSubproject
…tead of hardcoding 8
…he flutter tooling. this value has to be adjusted manually
10 tasks
reidbaker
approved these changes
Jun 26, 2026
This was referenced Jun 27, 2026
This was referenced Jun 29, 2026
This was referenced Jun 29, 2026
auto-submit Bot
pushed a commit
that referenced
this pull request
Jun 30, 2026
This was a manual cherry pick of #188373. ### Issue Link: What is the link to the issue this cherry-pick is addressing? #188718 ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping of production apps (the app crashes on launch). This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick. All existing Flutter Android apps and add-to-app scenarios that use AGP < 9 and apply KGP. ### Changelog Description: Explain this cherry pick: * In one line that is accessible to most Flutter developers. * That describes the state prior to the fix. * That includes which platforms are impacted. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples. < Replace with changelog description here > [flutter/188718](#186100): When building Flutter Android apps and add-to-app modules using AGP < 9 with KGP, the tool incorrectly logs Built-in Kotlin migration warnings. ### Workaround: Is there a workaround for this issue? This change must be made. Built-in Kotlin only exists starting AGP 9, therefore we should not be informing app developers to migrate when their apps are below AGP 9. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? - navigate to plugin camera_android_camerax in the packages repo - change versions to AGP: 8.11.1, Gradle: 8.14, KGP: 2.2.20 in settings.gradle.kts - add KGP id("kotlin-android") to the example app build.gradle.kts and the plugin module's build.gradle.kts - `flutter build apk` and the build is successful and you see no logs. Without this change, you will see logs both for app developers and for plugin authors.
auto-submit Bot
pushed a commit
that referenced
this pull request
Jun 30, 2026
This was a manual cherry pick of #188373. ### Issue Link: What is the link to the issue this cherry-pick is addressing? #188718 ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping of production apps (the app crashes on launch). This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick. All existing Flutter Android apps and add-to-app scenarios that use AGP < 9 and apply KGP. ### Changelog Description: Explain this cherry pick: * In one line that is accessible to most Flutter developers. * That describes the state prior to the fix. * That includes which platforms are impacted. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples. < Replace with changelog description here > [flutter/188718](#186100): When building Flutter Android apps and add-to-app modules using AGP < 9 with KGP, the tool incorrectly logs Built-in Kotlin migration warnings. ### Workaround: Is there a workaround for this issue? This change must be made. Built-in Kotlin only exists starting AGP 9, therefore we should not be informing app developers to migrate when their apps are below AGP 9. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? - navigate to plugin camera_android_camerax in the packages repo - change versions to AGP: 8.11.1, Gradle: 8.14, KGP: 2.2.20 in settings.gradle.kts - add KGP id("kotlin-android") to the example app build.gradle.kts and the plugin module's build.gradle.kts - `flutter build apk` and the build is successful and you see no logs. Without this change, you will see logs both for app developers and for plugin authors.
This was referenced Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warnings to migrate to built-in kotlin should not log when AGP is below 9. This should be CP'ed to the current stable and beta. This is an effort to split this large PR: #187534 (comment)
Fixes #188718
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-assistbot 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.