<!-- start_original_pr_link -->
Reverts: flutter/flutter#179647
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: gmackall
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Mac_mokey run_release_test failing
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: gmackall
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {reidbaker, jtmcdole}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
Changes our cipd hosted android sdk+ndk bundle to no longer modify
directory structure from what Android directly provides, allowing AGP to
find the ndk automatically and preventing downloading.
1. Changes the `create_cipd_packages.sh` script so we don't move the ndk
2. Uses the new script to upload a
[36v4unmodified](https://chrome-infra-packages.appspot.com/p/flutter/android/sdk/all/linux-amd64/+/version:36v4unmodified)
bundle
3. Changes DEPS+ci.yaml to reference the new bundle
4. Changes GN build rules accordingly
5. Removes special config in existing build.gradle files to point at the
location of the ndk - agp should now know where it is without conig
6. For some tests, passes in an environment variable pointing to the ndk
location, to override the environment variable passed by the recipes.
This variable is respected by the tool, so the recipes passing it,
pointing to the wrong place, is problematic. After this change lands we
can stop passing it in the recipes, and then we can remove this special
config in the tests. But adding it temporarily allows us to make this
change without coordinating a recipes change at the same moment, and
probably breaking things out of band.
Logs from a random postsubmit run of `Mac
build_android_host_app_with_module_aar` on the tree currently:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8695664517253382913/+/u/run_build_android_host_app_with_module_aar/stdout
We see
> [2025-12-12 10:49:49.223087] [STDOUT] stdout: Checking the license for
package NDK (Side by side) 28.2.13676358 in
/Volumes/Work/s/w/ir/cache/android/sdk/licenses
[2025-12-12 10:49:49.223221] [STDOUT] stdout: License for package NDK
(Side by side) 28.2.13676358 accepted.
[2025-12-12 10:49:49.223268] [STDOUT] stdout: Preparing "Install NDK
(Side by side) 28.2.13676358 v.28.2.13676358".
[2025-12-12 10:50:14.093824] [STDOUT] stdout: "Install NDK (Side by
side) 28.2.13676358 v.28.2.13676358" ready.
[2025-12-12 10:50:14.093909] [STDOUT] stdout: Installing NDK (Side by
side) 28.2.13676358 in
/Volumes/Work/s/w/ir/cache/android/sdk/ndk/28.2.13676358
[2025-12-12 10:50:14.093947] [STDOUT] stdout: "Install NDK (Side by
side) 28.2.13676358 v.28.2.13676358" complete.
[2025-12-12 10:50:14.410724] [STDOUT] stdout: "Install NDK (Side by
side) 28.2.13676358 v.28.2.13676358" finished.
Example of no longer downloading:
Logs from a presubmit run:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8695732180931529361/+/u/run_build_android_host_app_with_module_aar/stdout
We don't see these logs. We still see android build tools downloading -
we can probably tackle that in another pr.
## 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.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
Changes our cipd hosted android sdk+ndk bundle to no longer modify
directory structure from what Android directly provides, allowing AGP to
find the ndk automatically and preventing downloading.
1. Changes the `create_cipd_packages.sh` script so we don't move the ndk
2. Uses the new script to upload a
[36v4unmodified](https://chrome-infra-packages.appspot.com/p/flutter/android/sdk/all/linux-amd64/+/version:36v4unmodified)
bundle
3. Changes DEPS+ci.yaml to reference the new bundle
4. Changes GN build rules accordingly
5. Removes special config in existing build.gradle files to point at the
location of the ndk - agp should now know where it is without conig
6. For some tests, passes in an environment variable pointing to the ndk
location, to override the environment variable passed by the recipes.
This variable is respected by the tool, so the recipes passing it,
pointing to the wrong place, is problematic. After this change lands we
can stop passing it in the recipes, and then we can remove this special
config in the tests. But adding it temporarily allows us to make this
change without coordinating a recipes change at the same moment, and
probably breaking things out of band.
Logs from a random postsubmit run of `Mac
build_android_host_app_with_module_aar` on the tree currently:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8695664517253382913/+/u/run_build_android_host_app_with_module_aar/stdout
We see
> [2025-12-12 10:49:49.223087] [STDOUT] stdout: Checking the license for
package NDK (Side by side) 28.2.13676358 in
/Volumes/Work/s/w/ir/cache/android/sdk/licenses
[2025-12-12 10:49:49.223221] [STDOUT] stdout: License for package NDK
(Side by side) 28.2.13676358 accepted.
[2025-12-12 10:49:49.223268] [STDOUT] stdout: Preparing "Install NDK
(Side by side) 28.2.13676358 v.28.2.13676358".
[2025-12-12 10:50:14.093824] [STDOUT] stdout: "Install NDK (Side by
side) 28.2.13676358 v.28.2.13676358" ready.
[2025-12-12 10:50:14.093909] [STDOUT] stdout: Installing NDK (Side by
side) 28.2.13676358 in
/Volumes/Work/s/w/ir/cache/android/sdk/ndk/28.2.13676358
[2025-12-12 10:50:14.093947] [STDOUT] stdout: "Install NDK (Side by
side) 28.2.13676358 v.28.2.13676358" complete.
[2025-12-12 10:50:14.410724] [STDOUT] stdout: "Install NDK (Side by
side) 28.2.13676358 v.28.2.13676358" finished.
Example of no longer downloading:
Logs from a presubmit run:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8695732180931529361/+/u/run_build_android_host_app_with_module_aar/stdout
We don't see these logs. We still see android build tools downloading -
we can probably tackle that in another pr.
## 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.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: DoLT <dolt@guide.inc>
Co-authored-by: Gray Mackall <mackall@google.com>
Co-authored-by: John "codefu" McDole <john@mcdole.org>
<!-- start_original_pr_link -->
Reverts: flutter/flutter#175679
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jtmcdole
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Linux linux_unopt is now timing out in postsubmit
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: bkonyi
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {srawlins}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
The `flutter_analyzer_plugin` implements rules previously enforced by
the `dev/bots/analyze.dart` check run on the CI, allowing for earlier
detection of custom lint violations before a change is uploaded for
review.
Currently, the plugin implements the following rules:
- avoid_future_catch_error
- no_double_clamp
- no_stopwatches
- protect_public_state_subtypes
- render_box_intrinsics
Towards https://github.com/flutter/flutter/issues/175276
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
The `flutter_analyzer_plugin` implements rules previously enforced by
the `dev/bots/analyze.dart` check run on the CI, allowing for earlier
detection of custom lint violations before a change is uploaded for
review.
Currently, the plugin implements the following rules:
- avoid_future_catch_error
- no_double_clamp
- no_stopwatches
- protect_public_state_subtypes
- render_box_intrinsics
Towards https://github.com/flutter/flutter/issues/175276
## Description
Continuing the work from @jamilsaadeh97 to replace verbose null checks
with modern
[null_aware_elements](https://dart.dev/tools/linter-rules/use_null_aware_elements)
syntax.
This PR cleans up the remaining files not covered in the previous parts,
making the code more concise.
## Related PRs
- https://github.com/flutter/flutter/pull/172198
- https://github.com/flutter/flutter/pull/172306
- https://github.com/flutter/flutter/pull/172307
- https://github.com/flutter/flutter/pull/172322
## 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].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Towards https://github.com/flutter/flutter/issues/171900.
The "legacy" (`//version`) file has been "legacy" for years. This PR
allows deprecating and removing it in the near future.
Example of `//bin/cache/flutter.version.json`:
```json
{
"frameworkVersion": "3.33.0-1.0.pre-1070",
"channel": "master",
"repositoryUrl": "unknown source",
"frameworkRevision": "be9526fbaaaab9474e95d196b70c41297eeda2d0",
"frameworkCommitDate": "2025-07-22 11:34:11 -0700",
"engineRevision": "be9526fbaaaab9474e95d196b70c41297eeda2d0",
"engineCommitDate": "2025-07-22 18:34:11.000Z",
"engineContentHash": "70fb28dde094789120421d4e807a9c37a0131296",
"engineBuildDate": "2025-07-22 11:47:42.829",
"dartSdkVersion": "3.10.0 (build 3.10.0-15.0.dev)",
"devToolsVersion": "2.48.0",
"flutterVersion": "3.33.0-1.0.pre-1070"
}
```
Example of `//version`:
```txt
3.33.0-1.0.pre-1070
```
reland of https://github.com/flutter/flutter/pull/171927
towards https://github.com/flutter/flutter/issues/171790
Use the content aware hash when downloading engine artifacts. These are
currently produced when changes to DEPs, engine/, or the release file
are changed in a not-seen-before way.
We can eventually remove engine.version being tracked in release
branches as an optimization.
FLUTTER_PREBUILT_ENGINE_VERSION will stay for overriding the
engine.version for testing. Though Cocoon does not need to actually set
it for framework only PRs anymore.
fxies post submit tests for content_hash download:
SHARD=framework_tests SUBSHARD=misc dart --enable-asserts
dev/bots/test.dart
SHARD=tool_host_cross_arch_tests dart --enable-asserts
dev/bots/test.dart
```
╔═╡ERROR https://github.com/flutter/flutter/pull/1╞════════════════════════════════════════════════════════════════════
║ Expected "Flutter Engine Version: 45b085ab2118f30441ae6e2daab4b8eb3e4a063c", but found "Flutter Engine Version: 407c051ec9".
╚═══════════════════════════════════════════════════════════════════════════════
```
```
Expected: contains '45b085ab2118f30441ae6e2daab4b8eb3e4a063c'
Which: does not contain '45b085ab2118f30441ae6e2daab4b8eb3e4a063c'
```
The `frameworkVersion` string written to the version files wasn't
actually parsable by `GitTagVersion` as it didn't match the format
output by `git`.
This change updates the `frameworkVersion` format to use a `-` instead
of a `.` before the commit count and adds support to the version parsing
regex to handle both `.` and `-` separators before the commit count.
Fixes https://github.com/flutter/flutter/issues/172091
Sources under `packages/flutter_tools/` aren't accessible to the average
Flutter user by navigating through sources from their projects, so it
doesn't need to be as explicitly verbose with types for readability
purposes. The `always_specify_types` lint results in extremely verbose
code within the tool which adds little value.
This change disables `always_specify_types` in favor of a new set of
lints that aim to reduce verbosity by removing obvious types while also
maintaining readability in cases where variable types otherwise wouldn't
be obvious:
- `omit_obvious_local_variable_types`
- `omit_obvious_property_types`
- `specify_nonobvious_local_variable_types`
- `specify_nonobvious_property_types`
- **Relands "Bump warn and error versions of agp, kotlin and gradle
versions in preparation for gradle 9 (#171399)"**
- **bump lockfile generator to use kotlin 2.1.0**
- **Update formatting of lockfile to pass ktlint**
Updated lockfiles with
`JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/
dart dev/tools/bin/generate_gradle_lockfiles.dart` after
dev/tools/bin/generate_gradle_lockfiles.dart to bump the versions of
kotlin.
Failing tests from first attempt
https://flutter-dashboard.appspot.com/#/build?hashFilter=84a5ce765d193a9c79ab4297f367d5ad7efc5dac&showMac=false&showWindows=false&showiOS=false&showLinux=false&showBringup=true&repo=flutter&branch=master
Verified example test that cause revert was passing by running the
following
- `../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t
run_debug_test_android.dart` from `dev/devicelab`
- `../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t
run_release_test` from `dev/devicelab`
- `SHARD=android_engine_vulkan_tests bin/cache/dart-sdk/bin/dart
dev/bots/test.dart` from root with an android emulator. Hard to actually
verify because the emulator is closed as part of the tests but no
failures were from failures to compile.
- `flutter test
test/general.shard/android/android_project_migration_test.dart` from
`packages/flutter_tools/`
## 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].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
<!-- start_original_pr_link -->
Reverts: flutter/flutter#171399
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Many Gradle/Android related tasks are failing
([one
example](https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_mokey%20run_release_test/1347/overview))
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: reidbaker
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {gmackall}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
https://gradle.org/whats-new/gradle-9/ is coming and with it includes
some deprecated methods. Some like
https://github.com/flutter/flutter/pull/171397 can be fixed by
annotations and calling new methods. Some like the deprecation of
minsdkversion on Variant require bumping the minimum versions to be able
to compile code that will work.
b/368604254
## 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].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
https://gradle.org/whats-new/gradle-9/ is coming and with it includes
some deprecated methods. Some like
https://github.com/flutter/flutter/pull/171397 can be fixed by
annotations and calling new methods. Some like the deprecation of
minsdkversion on Variant require bumping the minimum versions to be able
to compile code that will work.
b/368604254
## 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].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Reworked the dependency model to be library based instead of script
based in order to support libraries spanning multiple scripts.
Also refactored test logic to improve maintainability and simply writing
tests against the `PreviewDetector`.
Running applications with `-d web-server --web-experimental-hot-reload`
was fixed in https://github.com/flutter/flutter/commit/b757dab. These
tests can now run with the hot reload support enabled.
Some of these request paths are not guaranteed to be requested by the
time the test is finished, which makes this test somewhat flaky. We
don't really care about verifying these requests specifically anyway, so
just don't track them or compare them to our expectations.
This fixes https://github.com/flutter/flutter/issues/171025
This PR is an attempt to reland
https://github.com/flutter/flutter/pull/168996
There were some issues that cropped up in the `web_long_running_test`
shards. However, it turns out that these tests don't actually run in
presubmit on any PR that has any engine changes, which is not ideal. I
modified the long running tests to run in presubmit, but this had issues
because apparently a big chunk of these integration tests actually are
trying to download canvaskit from CDN. I changed almost all of the tests
to use local canvaskit (which should make them more reliable and
hermetic). There is one test whose job is to actually test the CDN
itself, and I am leaving that disabled in presubmit for PRs that have
engine changes (since the engine artifacts won't be uploaded to CDN yet)
but the rest of them are all running and passing now.
Also, I fixed the underlying issue that was exposed by the long running
tests, which is that the CanvasKit path clipping stuff in the layer
visitor needs to be aware of LazyPath.