Skip to content

Revert "[AGP 9] Bumping KGP error minimum to 2.0.0 (#184385)"#184455

Closed
jason-simmons wants to merge 1 commit into
flutter:masterfrom
jason-simmons:revert_pr_184385
Closed

Revert "[AGP 9] Bumping KGP error minimum to 2.0.0 (#184385)"#184455
jason-simmons wants to merge 1 commit into
flutter:masterfrom
jason-simmons:revert_pr_184385

Conversation

@jason-simmons

@jason-simmons jason-simmons commented Apr 1, 2026

Copy link
Copy Markdown
Member

Reverts: #184385

Initiated by: jason-simmons

Reason for reverting: This is causing errors in the build_android_host_app_with_module_source integration test.

Example: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20build_android_host_app_with_module_source/7845/overview

https://github.com/flutter/flutter/blob/master/dev/integration_tests/pure_android_host_apps/host_app_kotlin_gradle_dsl/gradle/libs.versions.toml needs to be updated.

Original PR Author: jesswrd

Reviewed By: {gmackall}

This change reverts the following previous change:
Bumped KGP error and warn versions to support Built-in Kotlin migration. AGP and Gradle error and warn versions had to be bumped as a result of bumping KGP error and warn versions.

This will be CP'ed to beta and stable.

Fixes #184384
Addresses #181557

@jason-simmons jason-simmons requested a review from a team as a code owner April 1, 2026 13:35
@jason-simmons jason-simmons added the CICD Run CI/CD label Apr 1, 2026
@fluttergithubbot

Copy link
Copy Markdown
Contributor

An existing Git SHA, 05f442583099f0ef7726494b992c1a0ae80e2621, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@google-cla

google-cla Bot commented Apr 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Apr 1, 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 downgrades the version thresholds for Gradle, Android Gradle Plugin (AGP), and Kotlin Gradle Plugin (KGP) within the dependency checker and associated tests. Review feedback identifies inconsistencies between the updated test constants and the template versions in gradle_utils.dart, a version mismatch between the tool's KGP dependency and its error threshold, and concerns regarding the removal of maintainability comments.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/flutter_tools/gradle/src/test/kotlin/DependencyVersionCheckerTest.kt (56-59)

high

The updated constants SUPPORTED_GRADLE_VERSION, SUPPORTED_AGP_VERSION, and SUPPORTED_KGP_VERSION are inconsistent with the template versions defined in packages/flutter_tools/lib/src/android/gradle_utils.dart (which are 8.14, 8.11.1, and 2.2.20 respectively). The comments on lines 54-55 explicitly state that these values should match the template. To maintain consistency, either the template versions in gradle_utils.dart should also be reverted, or these constants should be updated to match the current templates.

packages/flutter_tools/gradle/build.gradle.kts (55)

medium

The kotlin-gradle-plugin version is being reverted to 1.8.0. However, DependencyVersionChecker.kt (line 108) defines the error threshold for users at 1.8.10. It is recommended to align the tool's own build dependencies with the minimum supported version to ensure compatibility. Additionally, the cross-reference comment was removed; it should be kept to ensure future updates are synchronized.

    // When bumping, also update:
    //  * KGP error version in packages/flutter_tools/gradle/src/main/kotlin/DependencyVersionChecker.kt
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")

packages/flutter_tools/lib/src/android/gradle_utils.dart (32-34)

medium

The removal of these "When bumping, also update" comments reduces the maintainability of the codebase. These cross-references are essential for ensuring that version updates are synchronized across the tool, the dependency checker, and the test suites. Please consider retaining them to adhere to the principle of optimizing for readability.

References
  1. Optimize for readability: Code is read more often than it is written. (link)

@reidbaker

Copy link
Copy Markdown
Contributor

I have filed #184456 and am marking those tests as skipped. The failure is that this test needs a higher agp version.

@reidbaker

Copy link
Copy Markdown
Contributor

I recommend not landing this revert.

@jason-simmons

Copy link
Copy Markdown
Member Author

SGTM - closing this.

@reidbaker

Copy link
Copy Markdown
Contributor

Thank you for proactively triggering a revert.

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] Raise KGP Error and Warn Version

3 participants