Skip to content

Conversation

@reidbaker
Copy link
Contributor

@reidbaker reidbaker commented Jul 10, 2025

I discovered we had a duplicate entry for what the min sdk api level flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions.
Updates the related tests
Updates workflow_test and android_workflow to compare against the compile sdk version since the validation was ensuring that the lastest of the installed sdks was at least what was needed for flutter to compile. This make this pr more than a formatting/refactoring change and an actual user facing change. Requesting re-review.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@reidbaker reidbaker requested review from bkonyi and gmackall July 10, 2025 15:08
@reidbaker reidbaker requested a review from a team as a code owner July 10, 2025 15:08
@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 Jul 10, 2025
- The flutter min version in `engine/src/flutter/shell/platform/android/io/flutter/Build.java`
- The versions used when engine testing in `engine/src/flutter/shell/platform/android/test_runner/build.gradle`
- The versions used when working in engine/shell in `engine/src/flutter/shell/platform/android/build.gradle`
- The minSdkVersion used in `packages/flutter_tools/lib/src/android/android.dart`
Copy link
Contributor

Choose a reason for hiding this comment

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

You mean in the packages/flutter_tools/lib/src/android folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes to this file reverted. I tried to exclude them.

Copy link
Contributor

@mboetger mboetger left a comment

Choose a reason for hiding this comment

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

LGTM - minor nit

String? sdkVersionText;
final AndroidSdkVersion? androidSdkLatestVersion = androidSdk.latestVersion;
if (androidSdkLatestVersion != null) {
if (androidSdkLatestVersion.sdkLevel < kAndroidSdkMinVersion ||
Copy link
Member

@gmackall gmackall Jul 10, 2025

Choose a reason for hiding this comment

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

I think this is doing something slightly different than checking the minSdk, right? Our min supported minSdk is 24, but this seems to be checking "what is the min version among sdk installations", which is a different value and I assume also why this is being checked against a significantly higher value. Perhaps @bkonyi knows why we have a restriction on the min installed sdk 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.

That would make sense and if so will cause me to modify this pr. Holding on a response from @bkonyi

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately I'm not sure myself. Can we look at the history of packages/flutter_tools/lib/src/android/android.dart and kAndroidSdkMinVersion in this file to try and figure out if there's a particular reason that they're different?

Copy link
Contributor Author

@reidbaker reidbaker Aug 4, 2025

Choose a reason for hiding this comment

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

I did some code spelunking. Looks like past flutter teams might have mixed the use of compileSdk and targetSdk but some of code was in place to set a minimum compile sdk version, some other of this code was for minimum build tool version.

#54382
#63517
a2e5e07#diff-c245d623bd123a206f90dc458d73520304e81ff8d1eac06a38e2c5221a859bfa

It also appears that the last time this value was updated was 2020. My choices now are to remove this code, update it to a higher min compile sdk version or to do nothing to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I am going to move the minimums to be together. Reread the exising code to confirm that the way we enforce compile time and minimum versions are what we want and leave the build tool enforcement alone.

});

testWithoutContext('Can install app on API level 16 or greater', () async {
testWithoutContext('Can install app on API level minSdk or greater', () async {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: maybe include the minSdk value here in the test name?

Something like:

Can install app on API level ${gradle_utils.minSdkVersion} or greater

or:

Can install app on API level minSdk (${gradle_utils.minSdkVersion}) or greater

String? sdkVersionText;
final AndroidSdkVersion? androidSdkLatestVersion = androidSdk.latestVersion;
if (androidSdkLatestVersion != null) {
if (androidSdkLatestVersion.sdkLevel < kAndroidSdkMinVersion ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately I'm not sure myself. Can we look at the history of packages/flutter_tools/lib/src/android/android.dart and kAndroidSdkMinVersion in this file to try and figure out if there's a particular reason that they're different?

@reidbaker reidbaker changed the title [android][tool] delete duplicate entry for minsdk version and update references [android][tool] Consolidate minimum versions for android projects. Aug 4, 2025
Copy link
Contributor

@mboetger mboetger left a comment

Choose a reason for hiding this comment

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

LGTM

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Aug 7, 2025
Merged via the queue into flutter:master with commit f15262c Aug 7, 2025
141 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2025
@reidbaker reidbaker deleted the r-template-version-bump-2025-07-10 branch August 7, 2025 14:48
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 7, 2025
flutter/flutter@9de63a0...92a6bfb

2025-08-07 [email protected] Roll Packages from f0b2726 to 6efb759 (4 revisions) (flutter/flutter#173414)
2025-08-07 [email protected] Provide monitor list, display size, refresh rate, and more for Windows (flutter/flutter#164460)
2025-08-07 [email protected] [android][tool] Consolidate minimum versions for android projects.  (flutter/flutter#171965)
2025-08-07 [email protected] Roll Fuchsia Linux SDK from 2Mo76-tiDj4ZCZbPv... to i4vsuEGyP8Xeb5tiy... (flutter/flutter#173409)
2025-08-07 [email protected] Roll Skia from 9a886bdfb716 to a6ccfeafbfba (1 revision) (flutter/flutter#173384)
2025-08-07 [email protected] Fix drawerScrimColor transition. (flutter/flutter#173280)
2025-08-07 [email protected] Roll Skia from dd60ed46a006 to 9a886bdfb716 (2 revisions) (flutter/flutter#173382)
2025-08-06 [email protected] Roll Skia from 05d82af3f4bd to dd60ed46a006 (2 revisions) (flutter/flutter#173376)
2025-08-06 [email protected] Roll Skia from 5518bb27db67 to 05d82af3f4bd (2 revisions) (flutter/flutter#173372)
2025-08-06 [email protected] Roll Skia from 9bb1fc4bc326 to 5518bb27db67 (2 revisions) (flutter/flutter#173363)
2025-08-06 [email protected] Roll Skia from a918c0e08500 to 9bb1fc4bc326 (24 revisions) (flutter/flutter#173355)

If this roll has caused a breakage, revert this CL and stop the roller
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
houssemeddinefadhli81 pushed a commit to houssemeddinefadhli81/flutter that referenced this pull request Aug 7, 2025
…lutter#171965)

I discovered we had a duplicate entry for what the min sdk api level
flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions. 
Updates the related tests
Updates workflow_test and android_workflow to compare against the
compile sdk version since the validation was ensuring that the lastest
of the installed sdks was at least what was needed for flutter to
compile. This make this pr more than a formatting/refactoring change and
an actual user facing change. Requesting re-review.
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…lutter#171965)

I discovered we had a duplicate entry for what the min sdk api level
flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions. 
Updates the related tests
Updates workflow_test and android_workflow to compare against the
compile sdk version since the validation was ensuring that the lastest
of the installed sdks was at least what was needed for flutter to
compile. This make this pr more than a formatting/refactoring change and
an actual user facing change. Requesting re-review.
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…lutter#171965)

I discovered we had a duplicate entry for what the min sdk api level
flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions. 
Updates the related tests
Updates workflow_test and android_workflow to compare against the
compile sdk version since the validation was ensuring that the lastest
of the installed sdks was at least what was needed for flutter to
compile. This make this pr more than a formatting/refactoring change and
an actual user facing change. Requesting re-review.
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…lutter#171965)

I discovered we had a duplicate entry for what the min sdk api level
flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions. 
Updates the related tests
Updates workflow_test and android_workflow to compare against the
compile sdk version since the validation was ensuring that the lastest
of the installed sdks was at least what was needed for flutter to
compile. This make this pr more than a formatting/refactoring change and
an actual user facing change. Requesting re-review.
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…lutter#171965)

I discovered we had a duplicate entry for what the min sdk api level
flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions. 
Updates the related tests
Updates workflow_test and android_workflow to compare against the
compile sdk version since the validation was ensuring that the lastest
of the installed sdks was at least what was needed for flutter to
compile. This make this pr more than a formatting/refactoring change and
an actual user facing change. Requesting re-review.
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants