Visitar URL original
Update gradle utils to know about kgp 2.3.10 constraints by reidbaker · Pull Request #183416 · flutter/flutter · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Try to make version more continuous
  • Loading branch information
reidbaker committed Mar 10, 2026
commit 25e672a94491e5ff89e2f4c69afabd991b454605
8 changes: 4 additions & 4 deletions packages/flutter_tools/lib/src/android/gradle_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ bool validateGradleAndKGP(Logger logger, {required String? kgpV, required String
// Documented max is 9.0.0, using 9.0.99 non inclusive covers patch versions.
return isWithinVersionRange(gradleV, min: '7.6.3', max: '9.0.99', inclusiveMax: false);
}
// Documented max is 2.3.0, using 2.2.29 covers patch versions.
if (isWithinVersionRange(kgpV, min: '2.2.20', max: '2.2.29')) {
// Documented max is 2.2.21, using 2.3.0 covers patch versions.
if (isWithinVersionRange(kgpV, min: '2.2.20', max: '2.3.0')) {
// Documented max is 8.14, using 8.14.99 non inclusive covers patch versions.
return isWithinVersionRange(gradleV, min: '7.6.3', max: '8.14.99', inclusiveMax: false);
}
Expand Down Expand Up @@ -694,12 +694,12 @@ bool validateAgpAndKgp(Logger logger, {required String? kgpV, required String? a
return isWithinVersionRange(agpV, min: '8.2.2', max: '9.0.99', inclusiveMax: false);
}
Comment on lines +691 to +695

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.

high

This new validation block for KGP 2.3.10+ is good, but it creates a validation gap. The next block only handles 2.3.0 specifically, leaving versions 2.3.1 through 2.3.9 unhandled. These will fall through all checks and be considered valid by default because the function returns true at the end, which is likely not the intended behavior.

To fix this, please adjust the next validation block to cover the gap, for example by changing its range to min: '2.3.0', max: '2.3.9'.

// Documented max is 2.3.0
if (isWithinVersionRange(kgpV, min: '2.3.0', max: '2.3.0')) {
if (isWithinVersionRange(kgpV, min: '2.3.0', max: '2.3.10', inclusiveMax: false)) {
// Documented max is 8.13.0
return isWithinVersionRange(agpV, min: '8.2.2', max: '8.14', inclusiveMax: false);
}
// Documented max is 2.2.20
if (isWithinVersionRange(kgpV, min: '2.2.20', max: '2.2.29')) {
if (isWithinVersionRange(kgpV, min: '2.2.20', max: '2.3.0', inclusiveMax: false)) {
// Documented max is 8.11.1
return isWithinVersionRange(agpV, min: '7.3.1', max: '8.12', inclusiveMax: false);
}
Expand Down