Skip to content

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

Open
jesswrd wants to merge 26 commits into
flutter:masterfrom
jesswrd:no-log-agp-smoll-9
Open

[AGP 9] Ensure Warnings Do Not Log When AGP Is Below 9#188373
jesswrd wants to merge 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)

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
@github-actions github-actions Bot added team-android Owned by Android platform team and removed CICD Run CI/CD labels Jun 24, 2026
@jesswrd jesswrd added CICD Run CI/CD and removed team-android Owned by Android platform team labels Jun 24, 2026
@github-actions github-actions Bot added team-android Owned by Android platform team CICD Run CI/CD and removed CICD Run CI/CD labels Jun 24, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 24, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 24, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 24, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 24, 2026
@jesswrd jesswrd requested a review from reidbaker June 24, 2026 18:35
"""
plugins {
id("com.android.application")
val pluginsBlock =

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.

in a comment can you give the expected output string for "pluginsBlock". I think it will help with understandability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

plugins {
id("com.android.library")
id("kotlin-android")
val legacyBlock =

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginUtilsTest.kt Outdated
Comment thread packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginUtilsTest.kt Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 24, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 24, 2026
@jesswrd jesswrd requested a review from reidbaker June 24, 2026 21:22
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 24, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 24, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 25, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 25, 2026
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.

2 participants