Skip to content

[CP] Correct warning for compatible Java versions range given template AGP & Gradle versions #136388

@camsim99

Description

@camsim99

Issue Link

#135710 has a description of the problem (I don't have one but I can open one if needed)

Commit Hash

54cf286

Target

beta

PR Link

#135710 #136766

Changelog Description

Corrects the range of Java versions that flutter create will show if your Java version is incompatible with Flutter's template AGP & Gradle versions and/or is too new/old a version to be recognized by Flutter's tooling.

The range currently printed suggests that the upper bound is inclusive, whereas it is exclusive, so it may confuse developers.

Impacted Users

All Flutter devs running flutter create for something running on Android

Impact Description

They will see a range of Java versions that is confusing. It can easily be found out as incorrect by following documentation linked in the warning, but we can't guarantee devs will look there to confirm the range of Java versions that we suggest.

Workaround

Following the documentation linked in the warning to check the Java versions.

Risk

low

Test Coverage

yes

Validation Steps

There are many tests that prove that the range is exclusive (

testWithoutContext('getJavaVersionFor returns expected Java version range', () {
). I just forgot to format the warning appropriately in #131444, where I added the warning.

Metadata

Metadata

Labels

cp: approvedApproved cherry-pick requestcp: merge-to-betaCherry-picks that should be merged to betacp: mergedCherry-pick has been merged to the release branch.cp: reviewCherry-picks in the review queue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions