Skip to content

[AGP 9] Ensure Warnings Do Not Log When AGP Is Below 9#188373

Merged
auto-submit[bot] merged 26 commits into
flutter:masterfrom
jesswrd:no-log-agp-smoll-9
Jun 26, 2026
Merged

[AGP 9] Ensure Warnings Do Not Log When AGP Is Below 9#188373
auto-submit[bot] merged 26 commits into
flutter:masterfrom
jesswrd:no-log-agp-smoll-9

Conversation

@jesswrd

@jesswrd jesswrd commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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-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 June 23, 2026 07:11
@jesswrd
jesswrd requested review from mboetger and removed request for a team June 23, 2026 07:11
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 23, 2026
@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jun 23, 2026

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

Copy link
Copy Markdown
Contributor

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 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.

Comment thread packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt Outdated
Comment thread packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt
Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginTest.kt
Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginTest.kt
…stubbed in FlutterPluginTest as applying FGP happens much earlier in lifecycle
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 23, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 23, 2026
@jesswrd
jesswrd requested review from reidbaker and removed request for mboetger June 23, 2026 08:00
update to all projects have been evaluated
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 23, 2026
Comment thread packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt
Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginUtilsTest.kt Outdated
Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginUtilsTest.kt Outdated
Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginUtilsTest.kt Outdated
@jesswrd jesswrd added the CICD Run CI/CD label Jun 25, 2026
@jesswrd jesswrd added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jun 26, 2026
Merged via the queue into flutter:master with commit 2a9599e Jun 26, 2026
169 of 170 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD platform-android Android applications specifically 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] Ensure No Warnings When Below AGP 9

2 participants