[CP-Beta] Raise Warn Version to AGP 9+#189293
Conversation
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
Raised warn version to AGP 9.0.1 and error version to right before AGP 9 for upcoming stable release. This way, most Flutter Android developers will upgrade their AGP version to 9.0.1, which means they will start seeing the Built-in Kotlin migration warnings. Since I intend on CP-ing this to beta, this PR contains the minimum required changes to raise the warn version to AGP 9.0.1 and the error version to 9.0.1. As in I changed `packages/flutter_tools/gradle/src/main/kotlin/DependencyVersionChecker.kt` and a lot of presubmits failed. All other changes had to be made in order to pass presubmits. The following test projects (or tests with projects) had minimal dependency upgrades in a while, so tests failed because they fell below the error version: - `flutter/dev/integration_tests/module_host_with_custom_build_v2_embedding` - `flutter/dev/integration_tests/pure_android_host_apps/android_custom_host_app` - `flutter/packages/flutter_tools/test/integration.shard/test_data/deferred_components_project.dart` - `flutter/packages/flutter_tools/test/integration.shard/android_gradle_legacy_flutter_plugins_strings_in_comments_test.dart` - `flutter/dev/devicelab/bin/tasks/android_java17_dependency_smoke_tests.dart` - `flutter/packages/flutter_tools/test/android_java17_integration.shard/android_dependency_version.dart` In this PR, I upgraded those dependency versions to the error version (the minimum change required). In a future PR (issue [here](flutter#189119)), I will align those project dependency versions with the current template versions (or at least a safer/modern version between the warn version and template version). ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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
…#189229) I raised the warn and error version in this PR: flutter#189109. The dependencies used by `flutter_engine_group_performance` were not updated as a part of that PR. I missed that update earlier, and I'm guessing that `flutter_engine_group_performance` is post-submit test. Fixes flutter#189228 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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
There was a problem hiding this comment.
Code Review
This pull request updates the warning and error thresholds for Gradle, AGP, and KGP versions across the Flutter codebase, including the dependency checker, build configurations, and integration tests. The review feedback highlights a test in android_dependency_version_checking_test.dart that will fail because its test versions fall below the new warning thresholds, and points out a redundant duplicate VersionTuple entry in android_java17_dependency_smoke_tests.dart that should be removed.
518263c
into
flutter:flutter-3.47-candidate.0
This was a manual cherry pick of #189109 and of #189229.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#189228
Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.
This affects all Flutter Android apps and add-to-app integrations below the new warn and error version thresholds. Apps below the warn version will successfully build with warning logs urging an upgrade. Apps below the error version will fail to build and receive logs to upgrade.
New Warn Version
AGP: 9.0.1
Gradle: 9.1.0
KGP: 2.3.20
New Error Version
AGP: 8.11.1
Gradle: 8.14
KGP: 2.2.20
Changelog Description:
Explain this cherry pick:
See best practices for examples.
< Replace with changelog description here >
flutter/189383: When building Flutter Android apps and add-to-app modules using AGP < 9, the tool does not prompt developers to upgrade to AGP 9+ or log Built-in Kotlin migration warnings.
Workaround:
Is there a workaround for this issue?
This change must be made. More develoeprs should upgrade to AGP 9+ to receive Built-in Kotlin migration warnings. To urge more developers to migrate to AGP 9+, we must raise the warn version to AGP 9+ to urge a larger chunk of our developers to migrate to AGP 9+. This must be done in this release because we don't have many Flutter releases left before AGP 10 releases.
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
To validate the new warn version:
flutter createa new appflutter build apkand the build is successful but you will see logs urging you to upgrade.-
flutter build apkand the build is successful and you will see no logsTo validate the new error version:
flutter build apkand the build will fail and you will see logs urging you to upgrade.-
flutter build apkand the build is successful and you will see no logsPre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.