Skip to content

Skip KGP version validation for AGP built-in Kotlin - #192206

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
wratheus:fix/builtin-kotlin-validation
Sep 8, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
wratheus:fix/builtin-kotlin-validation

Conversation

@wratheus

@wratheus wratheus commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #192167.

Summary

When android.builtInKotlin=true, Kotlin is bundled with AGP and cannot
be upgraded independently. This change skips Flutter's KGP minimum-version
validation for projects using AGP built-in Kotlin.

Tests

  • Added a regression test for an unsupported KGP version with
    android.builtInKotlin=true.
  • ./gradlew test --tests 'com.flutter.gradle.DependencyVersionCheckerTest'

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the AI contribution guidelines and understand my responsibilities.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant in-code documentation, or verified that none is needed for this internal validation change.
  • This PR does not introduce a new feature or capability; no flutter/website documentation issue or PR is needed.
  • I added new tests to check the change I am making.
  • This is not a breaking change and does not require Data Driven Fixes.
  • The relevant existing and new tests are passing.

@wratheus
wratheus requested a review from a team as a code owner September 2, 2026 22:09
@wratheus
wratheus requested review from gmackall and removed request for a team September 2, 2026 22:09
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@google-cla

google-cla Bot commented Sep 2, 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.

@wratheus
wratheus force-pushed the fix/builtin-kotlin-validation branch from 9383f93 to b268ea4 Compare September 2, 2026 22:13
@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 2, 2026
@wratheus

wratheus commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

And one remark
This fixes the validation failure for AGP Built-in Kotlin.

But the 2.2.20 minimum still applies to projects that use KGP directly by old method. Is there a
compatibility reason for that limit? If not, should it be lowered to 2.2.10,
or derived from the AGP/Kotlin compatibility matrix and probably be same as recommended by AGP?

@gmackall
gmackall requested a review from jesswrd September 3, 2026 18:53
@jesswrd jesswrd added the CICD Run CI/CD label Sep 3, 2026
Comment thread packages/flutter_tools/gradle/src/main/kotlin/DependencyVersionChecker.kt Outdated

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for the pr, this is a good fix but I left a comment about using an existing helper (which will solve incorrectness on AGP9+)

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 3, 2026
@gmackall gmackall added the CICD Run CI/CD label Sep 3, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 3, 2026
@wratheus
wratheus force-pushed the fix/builtin-kotlin-validation branch from b4b28bb to 947a1ab Compare September 3, 2026 20:24

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@wratheus

wratheus commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @gmackall
Thanks! Updated in 947a1ab.

This now uses FlutterPluginUtils.isBuiltInKotlinEnabled(project, agpVersion). I also updated the regression test.

For projects that still apply KGP directly: is the 2.2.20 error minimum a deliberate Flutter support-policy threshold, rather than an AGP/Kotlin compatibility requirement? The compatibility tables still include KGP 2.2.10 with older AGP/Gradle versions.

@gmackall

gmackall commented Sep 3, 2026

Copy link
Copy Markdown
Member

For projects that still apply KGP directly: is the 2.2.20 error minimum a deliberate Flutter support-policy threshold, rather than an AGP/Kotlin compatibility requirement? The compatibility tables still include KGP 2.2.10 with older AGP/Gradle versions.

Yes, the versions in
packages/flutter_tools/gradle/src/main/kotlin/DependencyVersionChecker.kt
are intended to be flutter policy, not necessarily a reflection of intra-dependency version validation. We implemented the checker because we believed keeping the flutter ecosystem moving forward in dependency versions is healthy, and in the absence of we fear people have a tendency to let their dependencies essentially bit rot

@gmackall gmackall added the CICD Run CI/CD label Sep 3, 2026
@wratheus

wratheus commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Makes sense, thanks for clarifying!

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 8, 2026
Merged via the queue into flutter:master with commit 05bb83a Sep 8, 2026
26 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 9, 2026
flutter/flutter@b444e78...63b9518

2026-09-09 [email protected] Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 [email protected] Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 [email protected] Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 [email protected] [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 [email protected] [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 [email protected] [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 [email protected] [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 [email protected] Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 [email protected] [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 [email protected] [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 [email protected] [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 [email protected] [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 [email protected] [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 [email protected] Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 [email protected] et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 [email protected] Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 [email protected] [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 [email protected] [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 [email protected] [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 [email protected] [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 [email protected] Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12814)

flutter/flutter@b444e78...63b9518

2026-09-09 [email protected] Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 [email protected] Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 [email protected] Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 [email protected] [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 [email protected] [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 [email protected] [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 [email protected] [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 [email protected] Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 [email protected] [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 [email protected] [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 [email protected] [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 [email protected] [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 [email protected] [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 [email protected] Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 [email protected] et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 [email protected] Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 [email protected] [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 [email protected] [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 [email protected] [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 [email protected] [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 [email protected] Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12814)

flutter/flutter@b444e78...63b9518

2026-09-09 [email protected] Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 [email protected] Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 [email protected] Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 [email protected] [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 [email protected] [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 [email protected] [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 [email protected] [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 [email protected] Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 [email protected] [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 [email protected] [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 [email protected] [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 [email protected] [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 [email protected] [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 [email protected] Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 [email protected] et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 [email protected] Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 [email protected] [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 [email protected] [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 [email protected] [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 [email protected] [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 [email protected] Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
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 tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter Gradle plugin rejects AGP Built-in Kotlin version

4 participants