Skip to content

Conversation

@reidbaker
Copy link
Contributor

@reidbaker reidbaker commented Sep 22, 2025

Update the maxKnownAndSupported versions of Java (now 26), AGP (from 8.9.1 to 8.13), and Gradle (now 9.1).

Add tests for new codepaths and expand existing test coverage. Some typos and changes to aid debugging included as well.

AGP 9 was made available for preview last week https://developer.android.com/build/releases/agp-preview.

Fixes: #175669

Commits:

  • update max known and supported java, gradle and agp
  • make tests in a loop and add testing for get java version for and validate java and agp
  • move some tests to gradle_utils, make debugging easier
  • Migrated gradle_utils tests from gradle_test to gradle_utils_test

@reidbaker reidbaker requested a review from a team as a code owner September 22, 2025 20:40
@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Sep 22, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 effectively updates the maximum known and supported versions of Java, AGP, and Gradle, which is crucial for the analyze --suggestions feature. The changes are well-structured, with updated constants and compatibility matrices. I appreciate the significant effort in expanding the test coverage and refactoring the tests to be data-driven, which greatly improves maintainability. I've found a couple of minor duplications in the test data that could be cleaned up.

});
});

group('gradle version', () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests were moved to gradle_utils_test

@reidbaker reidbaker requested a review from gmackall September 22, 2025 20:47
@reidbaker
Copy link
Contributor Author

@gmackall While authoring this pr I believe the decision we made in https://github.com/flutter/flutter/pull/175808/files#diff-afa4fef23f35d6a99b734a7c1ec54b98750e48714a3026e2f2eccb5468ca488cR969-R977 was incorrect and that if AGP is higher than maxKnownAndSupportedAgpVersion we should assume java is valid if it is equal to or higher than the last known supported java version.

Users with very new agp versions and older flutter_tool versions would false negative pretty regularly. Especially since java 17 is supported for many years worth of agp versions.

If you agree I will make that change in a different pr since I think changing default behavior is riskier.

@gmackall
Copy link
Member

@gmackall While authoring this pr I believe the decision we made in https://github.com/flutter/flutter/pull/175808/files#diff-afa4fef23f35d6a99b734a7c1ec54b98750e48714a3026e2f2eccb5468ca488cR969-R977 was incorrect and that if AGP is higher than maxKnownAndSupportedAgpVersion we should assume java is valid if it is equal to or higher than the last known supported java version.

Users with very new agp versions and older flutter_tool versions would false negative pretty regularly. Especially since java 17 is supported for many years worth of agp versions.

If you agree I will make that change in a different pr since I think changing default behavior is riskier.

I agree we should default to assuming the Java version is fine if we know nothing about the AGP version

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 24, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 24, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 24, 2025

autosubmit label was removed for flutter/flutter/175808, because - The status or check suite Linux firebase_release_smoke_test has failed. Please fix the issues identified (or deflake) before re-applying this label.

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 24, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Sep 24, 2025
@jtmcdole jtmcdole removed this pull request from the merge queue due to a manual request Sep 24, 2025
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 24, 2025
@jtmcdole jtmcdole added this pull request to the merge queue Sep 24, 2025
@jtmcdole
Copy link
Member

PR Was stuck in the merge queue; removed and re-added.

Merged via the queue into flutter:master with commit c121890 Sep 25, 2025
150 of 151 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 25, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 25, 2025
Roll Flutter from 4a042046a0f1 to b1a28bc065b0 (44 revisions)

flutter/flutter@4a04204...b1a28bc

2025-09-25 [email protected] web_ui: avoid crash for showPerformanceOverlay; log 'not supported' once (flutter/flutter#173518)
2025-09-25 [email protected] Ignore upcoming `experimental_member_use` warnings. (flutter/flutter#175969)
2025-09-25 [email protected] Roll Skia from 753ce2221ce7 to 55436d87e414 (16 revisions) (flutter/flutter#176004)
2025-09-25 [email protected] Add google_fonts to team-framework triage guidelines (flutter/flutter#175675)
2025-09-25 [email protected] Add tests for InputDecoration borders (M3 and theme normalization) (flutter/flutter#175838)
2025-09-24 [email protected] Update Flutter's templates to use dot shorthands (flutter/flutter#175891)
2025-09-24 [email protected] In Gradle Flutter task, correctly replace '\ ' with ' '. (flutter/flutter#175815)
2025-09-24 [email protected] Cleans up navigator pop and remove logic (flutter/flutter#175612)
2025-09-24 [email protected] Fix docs in `EditableText` (flutter/flutter#175787)
2025-09-24 [email protected] Fixes SemanticsFlags.isLink mis-translated in dart ui ffi (flutter/flutter#175812)
2025-09-24 [email protected] Update AGP/Java/Gradle comparison when using analyze --suggestions (flutter/flutter#175808)
2025-09-24 [email protected] Fix SliverMainAxisGroup SliverEnsureSemantics support (flutter/flutter#175671)
2025-09-24 [email protected] Migrate to `WidgetStateColor` (flutter/flutter#175573)
2025-09-24 [email protected] Make sure that a FlexibleSpaceBar doesn't crash in 0x0 environment (flutter/flutter#175228)
2025-09-24 [email protected] Roll Fuchsia Test Scripts from BWj3yYC74ud58QhN0... to APSBP-sS-3FX69Ihf... (flutter/flutter#175944)
2025-09-24 [email protected] Make sure that a MaterialApp doesn't crash in 0x0 environment (flutter/flutter#173090)
2025-09-24 [email protected] feat(cupertino): Add selectableDayPredicate parameter to CupertinoDatePicker for selectable day control #171332 (flutter/flutter#171334)
2025-09-24 [email protected] Refactor `FlutterInjectorTest` to use lambdas/method reference (flutter/flutter#175777)
2025-09-24 [email protected] Replace curly braces with lambdas in `KeyEventChannelTest` (flutter/flutter#175729)
2025-09-24 [email protected] [ Widget Preview ] Fix filter by file on Windows (flutter/flutter#175783)
2025-09-24 [email protected] use lambda expressions /method reference to fix linter issue in `DartMessengerTest.java` (flutter/flutter#175733)
2025-09-24 [email protected] Roll Packages from 3413b65 to 117bf63 (9 revisions) (flutter/flutter#175935)
2025-09-24 [email protected] refactor code to use method reference and lambdas in `DartMessengerTest.java` (flutter/flutter#175731)
2025-09-24 [email protected] Simplify/fix ordering of asserts in `TextInputPluginTest` (flutter/flutter#175784)
2025-09-24 [email protected] Introduce a getter for `Project` to get `gradle-wrapper.properties` directly   (flutter/flutter#175485)
2025-09-24 [email protected] Change the arguments order in `assertEquals` to fix linter issues (flutter/flutter#175719)
2025-09-24 [email protected] Broken link in NavigationRail documentation (flutter/flutter#175852)
2025-09-24 [email protected] Updates to flutter web triage links (flutter/flutter#175791)
2025-09-24 [email protected] Do not present textures in FlutterMetalLayer if the drawable size changed and the texture's size does not match the new drawable size (flutter/flutter#175450)
2025-09-24 [email protected] Remove comment about trailing commas from templates (flutter/flutter#175864)
2025-09-24 [email protected] Roll Skia from 1c1b19f2ffc3 to 753ce2221ce7 (4 revisions) (flutter/flutter#175909)
2025-09-24 [email protected] Roll Skia from 3191a822cf10 to 1c1b19f2ffc3 (2 revisions) (flutter/flutter#175896)
2025-09-24 [email protected] Roll Skia from cabeab8cb22c to 3191a822cf10 (14 revisions) (flutter/flutter#175894)
2025-09-24 [email protected] Roll Dart SDK from 14b4ced3022a to 899c7340cc4c (4 revisions) (flutter/flutter#175893)
2025-09-24 [email protected] Roll `package:analyzer` forward to `8.2.0`. (flutter/flutter#175849)
2025-09-24 [email protected] Make sure that a VerticalDivider doesn't crash at 0x0 environment (flutter/flutter#174761)
2025-09-24 [email protected] Make sure that Drawer & DrawerHeader don't crash in 0x0 environment (flutter/flutter#174772)
2025-09-24 [email protected] Add an assertion for the relationship between `Visibility.maintainState` and `Visibility.maintainFocusability` (flutter/flutter#175552)
2025-09-24 [email protected] fix: remove final class modifier on MenuController (flutter/flutter#174490)
2025-09-24 [email protected] fix: cupertino sheet broken example with programatic pop (flutter/flutter#175709)
2025-09-24 [email protected] [web] Fix assertion thrown when hot restarting during animation (flutter/flutter#175856)
2025-09-24 [email protected] Add non uniform TableBorder (flutter/flutter#175773)
2025-09-23 [email protected] fix small typo in test docs (flutter/flutter#175776)
2025-09-23 [email protected] Use `assertNull` to simplify code (flutter/flutter#175720)

If this roll has caused a breakage, revert this CL and stop the roller
...
@reidbaker reidbaker added cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch labels Sep 25, 2025
@reidbaker reidbaker deleted the i175669_update_agp_java_gradle_comparison branch September 25, 2025 19:19
@flutteractionsbot
Copy link

Failed to create CP due to merge conflicts.
You will need to create the PR manually. See the cherrypick wiki for more info.

1 similar comment
@flutteractionsbot
Copy link

Failed to create CP due to merge conflicts.
You will need to create the PR manually. See the cherrypick wiki for more info.

reidbaker added a commit that referenced this pull request Oct 1, 2025
…175808)

Update the maxKnownAndSupported versions of Java (now 26), AGP (from
8.9.1 to 8.13), and Gradle (now 9.1).

Add tests for new codepaths and expand existing test coverage. Some
typos and changes to aid debugging included as well.

AGP 9 was made available for preview last week
https://developer.android.com/build/releases/agp-preview.

Fixes: #175669


Commits: 
- **update max known and supported java, gradle and agp**
- **make tests in a loop and add testing for get java version for and
validate java and agp**
- **move some tests to gradle_utils, make debugging easier**
- **Migrated gradle_utils tests from gradle_test to gradle_utils_test**

---------

Co-authored-by: Camille Simon <[email protected]>
auto-submit bot pushed a commit that referenced this pull request Oct 7, 2025
Fixes #175669 

Changelog entry
- [flutter/175669](#175669) When running `flutter analyze --suggestions` include compatibility info for Gradle 9.1, AGP 9.0, Java 25 and Kotlin 2.2.20 and below.

Cherry pick the following prs. 
- **Update maximum known Gradle version to 9.1.0 (#175543)**
- **Update AGP/Java/Gradle comparison when using analyze --suggestions (#175808)**
- **Add kotlin/kgp 2.2.* evaluation criteria.  (#176094)**
- **Update java version ranges with the top end limitation for java pre 17 (#176049)**

Cherry pick info: 
Yes this is covered by tests. 
Risk: low, this code is run as part of a seldom used command and any bugs are likely better than false negatives.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
reidbaker added a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…lutter#175808)

Update the maxKnownAndSupported versions of Java (now 26), AGP (from
8.9.1 to 8.13), and Gradle (now 9.1).

Add tests for new codepaths and expand existing test coverage. Some
typos and changes to aid debugging included as well.

AGP 9 was made available for preview last week
https://developer.android.com/build/releases/agp-preview.

Fixes: flutter#175669


Commits: 
- **update max known and supported java, gradle and agp**
- **make tests in a loop and add testing for get java version for and
validate java and agp**
- **move some tests to gradle_utils, make debugging easier**
- **Migrated gradle_utils tests from gradle_test to gradle_utils_test**

---------

Co-authored-by: Camille Simon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch 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.

Flutter analyze --suggestions gives false negative

5 participants