Roll packages to the ones published today.
Note that `native_assets_cli` was split up into `hooks` and
`code_assets`, and `native_assets_builder` was renamed to
`hooks_runner`.
Fixes https://github.com/flutter/flutter/issues/161443
* adds a new gradle task like `javaVersion` named `kgpVersion` that
prints the version of kgp.
* adds gradle_utils.dart method for getting kgp version
* * kgp method is moved to utilities and we attempt to use a plugin
method before reflection.
* adds methods or evaluating KGP + gradle and KGP + AGP compatibility.
* * It turns out that we have been using incompatible versions that
happen to work with the subset of kotlin we are using.
* Uses new kgp methods in flutter analyze --suggestions as part of the
existing agp/java/gradle compatibility matrix.
* adds new tests for all new functionality
* Adds comments to sections of the code I found could use them.
* Modifies flutter gallery to use a compatible version of kotlin and
update its lockfiles.
## 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.
Roll forward deps to the ones published today.
Note: `package:native_assets_cli` has a lower-bound on a Dart SDK dev
version to signal for which version of Dart and Flutter it is compatible
with. This means all these packages now have pre-release versions. Since
native assets is in experimental mode and not available on the
stable/beta branches, this is as expected.
Test exempt: Covered by existing tests, only rolling forward deps.
This PR is the dual of
https://dart-review.googlesource.com/c/sdk/+/420700 in the Dart SDK.
This PR adds support for user-defines for hooks in the root package
`pubspec.yaml`.
```yaml
hooks:
user_defines:
hook_user_defines: # package name
magic_value: 1000
```
For more design considerations see:
* https://github.com/dart-lang/native/issues/39
### Testing
This PR is covered by
`test/integration.shard/isolated/native_assets_test.dart`.
In this PR, we add a new test project
`dev/integration_tests/hook_user_defines/` and add a dependency on that
project in the mentioned test.
The integration test already covers `flutter run`, `flutter test`, and
`flutter build`.
Updating the dart-lang/native dependencies to the ones published today.
No functional changes, but `CodeAsset` does not expose an `architecture`
and `os ` anymore (https://github.com/dart-lang/native/issues/2127).
Instead these should be taken from what is passed in for the
`CodeConfig`. This PR refactors the `DartBuildResult` to carry around
the `Target` with `CodeAsset`s as `FlutterCodeAsset`s.
(This PR avoid refactoring relevant code due to
https://github.com/flutter/flutter/pull/164094 already refactoring this
code.)
Refactor: Migrate to Theme.brightnessOf method
fixes: #163837
## 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 `///`).
- [ ] 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.
This reverts commit
8dccbc33df.
Find/replace didn't catch the use of `jvmTarget = "1.8"` in
`dev/integration_tests/android_engine_test/android/app/build.gradle` and
`android_engine_test` needed to have `"com.android.application"`
updated.
Should resolve issues related to the following messages being output on
stderr:
```
warning: [options] source value 8 is obsolete and will be removed in a future release"
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
```
Fixes https://github.com/flutter/flutter/issues/165973
Fixes#162107
Commands that were helpful when working on this pr.
`dart dev/tools/bin/generate_gradle_lockfiles.dart
--no-gradle-generation` from flutter/flutter root.
`./gradlew test` from packages/flutter_tools/gradle.
`git add -- ":*.lockfile"` for adding only lockfile changes.
`../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t
android_java11_dependency_smoke_tests` from dev/devicelab
`ktlint --editorconfig=dev/bots/test/analyze-test-input/.editorconfig
--baseline=dev/bots/test/analyze-test-input/ktlint-baseline.xml
packages/flutter_tools/gradle/src/ --format` formatting kotlin code.
Need ktlint 1.5
## 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.
## `integration_ui_keyboard_resize` flakiness reduction
This PR addresses flakiness in the `integration_ui_keyboard_resize` test
(issue #161300) and slightly improves its performance.
**Issue summary:**
The `integration_ui_keyboard_resize` test occasionally fails because the
device keyboard does not reliably open at the start of the test. This PR
mitigates one cause of this flakiness, though other potential underlying
issues may still exist. See #161300 for a detailed investigation.
**Changes and rationale:**
1. **Improved keyboard detection logic (flakiness reduction):**
* The core change moves `await driver.tap(defaultTextField);` *inside*
the loop that checks for layout changes. This ensures the test
repeatedly attempts to open the keyboard *while* waiting for the
expected layout shift, significantly improving reliability.
* **Local testing results (MacBook Pro M1 + Pixel 8 Pro):**
* **Original implementation:** Consistent failures within the first 15
iterations.
* **This PR:** Ran consistently for at least 300 iterations (out of
2000) before any failure, with some runs exceeding 900 iterations.
2. **`enableTextEntryEmulation` configuration improvement:**
* The `keyboard_resize.dart` app is *exclusively* used for testing and
requires `enableTextEntryEmulation: false` for proper device keyboard
interaction.
* This PR sets `enableTextEntryEmulation: false` directly within the
app's `enableFlutterDriverExtension` setup. This simplifies the test
setup, avoids cross-thread communication, and prevents the app from
appearing broken when run independently (as manual text input wouldn't
work otherwise).
3. **UI enhancements for manual testing:**
* Added `SafeArea` and `InputDecoration` to `keyboard_resize.dart`. This
ensures the `TextField` is fully visible and usable during manual
testing (it was previously obscured by the Android status bar). This
improves the developer experience when debugging the app directly.
4. **Optimized polling for speed:**
* Reduced the polling interval and increased the number of polling
iterations (maintaining the overall timeout). This change resulted in a
~2-second speed improvement per test iteration during local testing.
**Further flakiness improvement discussion and ideas**
See the discussion at https://github.com/flutter/flutter/issues/161300
**Testing and reproduction:**
To reproduce the original flakiness and verify the fix (reproducibility
may vary based on setup; see
https://github.com/flutter/flutter/issues/161300#issuecomment-2618952501):
1. **Disable automatic reboots:** Comment out the `await
checkForRebootRequired();` line in
9e273d5e6e/dev/devicelab/lib/framework/framework.dart (L240-L243)
2. **Disable automatic retries:** Set `static const int retryNumber =
0;` in
9e273d5e6e/dev/devicelab/lib/framework/cocoon.dart (L56-L57)
3. **Install `hyperfine`:** This is a command-line benchmarking tool
(e.g., `brew install hyperfine` on macOS).
4. **Connect a device/emulator:** Connect a physical Android device or
start an emulator.
5. **Run repeated tests:** Use `hyperfine` to run the test multiple
times and capture the output:
```bash
hyperfine -r 100 'dart bin/test_runner.dart test -t
integration_ui_keyboard_resize > log.txt'
```
Related to #149836
Find all jvmTarget definitions that do not use JavaVersion.* then update
them.
While editing those files align the usages with
docs/contributing/Android-API-And-Related-Versions.md.
Documentation source that this pr follows
https://github.com/flutter/flutter/pull/164198/files#diff-ee6ec18be8d752e2696c8ccc8bec2f202dfc29a43b3b4f9d8041aa6bc3e852a1
This pr is expected to cause no behavioral changes.
This pr makes logical sense after
https://github.com/flutter/flutter/pull/164198 but can be landed in any
order.
## 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 `///`).
- [ ] 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.
Related to #149836
- Remove last usages of minSdkVersion/compileSdkVersion/targetSdkVersion
in favor of minSdk/compileSdk/targetSdk. That do not also use
`flutter.minSdkVersion` etc. (that will happen in another pass)
- Update the files that used "SdkVersion" to use equals for setting new
values. [Not yet landed documentation
change](https://github.com/flutter/flutter/pull/164195/files#diff-ee6ec18be8d752e2696c8ccc8bec2f202dfc29a43b3b4f9d8041aa6bc3e852a1)
- align sourceCompatibility and targetCompatibility across repo to use
JavaVersion.* and update android version documentation.
This pr updates `kotlinOptions jvmTarget` documentation but does not fix
all existing usages.
This pr is expected to cause no behavioral changes.
This pr makes logical sense after
https://github.com/flutter/flutter/pull/164195 but can be landed in any
order.
## 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 `///`).
- [ ] 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.
Related to #149836
Last of the non api 35 references in flutter/flutter for targetSdk and
compileSdk.
`find . -type f -name "build.gradle" | xargs grep -e "targetSdk" | tr -d
'=' | tr -s ' ' | grep -v flutter\.targetSdkVersion | grep -v
engine/src/flutter/third_party/ | grep -v "targetSdk 35"`
`find . -type f -name "build.gradle" | xargs grep -e "compileSdk" | tr
-d '=' | tr -s ' ' | grep -v flutter\.compileSdkVersion | grep -v
engine/src/flutter/third_party/ | grep -v "compileSdk 35"`
rewrite of https://github.com/flutter/flutter/pull/163622 after this
test was updated to run against a newer version of gradle and agp in
https://github.com/flutter/flutter/pull/163849/files#diff-83b6ad7c016bffbb682664eb65c576a7ebf9c312fc60727c0e0e20f5641cbc2aR462
Android-API-And-Related-Versions.md was updated to reflect that after
further investigation that android is using "=" in their documentation
and that the space syntax is discouraged. Equals is setting a property
and space is the equivalent to a function call like `compileSdk(35)` and
assignment is prefered.
The use of equals for proprty assignment also aligns with
https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html#prepare_your_groovy_scripts
## 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.
Fixes#163750
Adds local.properties in any directory to the repo wide gitignore.
Test changes to make the test easier to debug, specifically identifying
the difference between a debug and release failure.
## 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.