Repository navigation
[Android] Add Flutter 3.50 breaking-change page for minimum build tool versions - #14090
reidbaker-agent wants to merge 5 commits into
Conversation
| AGP `9.3.1` (with Gradle `9.5.0`), with `android.builtInKotlin=false` and | ||
| `android.builtInKotlin=true`. | ||
| For plugin migration details, consult the | ||
| Verify your plugin's `example/` app against both supported configurations: |
There was a problem hiding this comment.
@jesswrd do you think plugin developers need to do this? in general most plugins do not do crazy gradle things and the ones that do know how to test across gradle versions.
There was a problem hiding this comment.
I think plugin developers should test against a configuration. It does not have to be both configurations. do this. On Flutter 3.50, I recommend plugin authors their example apps build with AGP 9.3.1 with Gradle 9.5.0. If they can't for some reason, they should at minimum test against AGP 9.1.1 with Gradle 9.3.1.
There was a problem hiding this comment.
@reidbaker, can you modify this text as per @jesswrd, who feels that testing it against one configuration is sufficient.
| Test each configuration with `android.builtInKotlin=false` and | ||
| `android.builtInKotlin=true` in `example/android/gradle.properties`. |
There was a problem hiding this comment.
@jesswrd I can see you wanting to test with this but want confirmation.
| When you're ready to adopt AGP 9's defaults: | ||
| Use the following guides when you're ready to adopt the AGP 9 defaults: | ||
|
|
||
| - To migrate to built-in Kotlin (`android.builtInKotlin=true`), follow |
|
/gcbrun |
There was a problem hiding this comment.
Code Review
This pull request adds a new breaking change document detailing the raised minimum Android build tool versions for Flutter 3.50, which now requires Android Gradle Plugin 9.1.1, Gradle 9.3.1, and Kotlin Gradle Plugin 2.4.10. It also updates the breaking changes index to link to this new page. The review feedback suggests clarifying the explanations of how Gradle resolves Kotlin Gradle Plugin (KGP) versions in the plugins block versus how the Flutter Gradle Plugin (FGP) directly validates ext.kotlin_version to avoid confusing developers.
| In `settings.gradle(.kts)`, Gradle resolves unpinned KGP versions up to | ||
| `2.4.10` and logs a warning. | ||
| Pinning KGP below `2.4.10`, or setting `ext.kotlin_version` below `2.4.10`, | ||
| fails validation. |
There was a problem hiding this comment.
Calling KGP versions in the plugins {} block "unpinned" is confusing to developers, as the template explicitly specifies a version (e.g., version "2.4.0"). In Gradle, these are overridden/upgraded by the buildscript classpath dependencies (like FGP), not because they are "unpinned". Clarifying this distinction makes the validation behavior much easier to understand.
Suggested change:
In `settings.gradle(.kts)`, Gradle resolves KGP versions declared in the
`plugins {}` block up to `2.4.10` and logs a warning.
Setting `ext.kotlin_version` below `2.4.10` directly in `build.gradle`
fails validation.References
- The repository style guide specifies that documentation prose follows the Google developer documentation style guide, prioritizing clarity and accuracy for readers, and that comments should include the problem, consequence, and smallest useful fix. (link)
There was a problem hiding this comment.
Updated in 9e31c5d: clarified that Gradle dependency resolution upgrades lower KGP versions in settings.gradle(.kts) plugins {} (such as 2.4.0) to 2.4.10 with a warning, and that only a strict KGP version constraint below 2.4.10 fails validation.
|
Staged preview of the updated docs.flutter.dev site (updated for commit 9e31c5d): https://flutter-docs-prod--docs-pr14090-android-3-50-build-too-r55mlqon.web.app |
…ts, and clarify KGP resolution
|
/gcbrun |
Description of what this PR is changing or adding, and why:
Adds the Flutter 3.50 Android breaking-change and migration guide
Raised minimum Android build tool versions
(
/release/breaking-changes/android-build-tool-minimum-versions,split out from #14053)
and lists the page under "Released in Flutter 3.50" in the breaking-changes
index:
Gradle 9.3.1 (up from 8.14.0), and KGP 2.4.10 when KGP is applied
(up from 2.2.20), along with the Flutter 3.50 template defaults
(AGP 9.3.1, Gradle 9.5.0, KGP 2.4.20) and the validation error rejecting
AGP 10+.
3.50 minimums, Flutter apps and add-to-app host projects below the minimums
(including unmodified apps created with Flutter 3.47 or earlier), standalone
Flutter modules, and Android plugins.
settings.gradle.ktsplugins {}blocks andgradle-wrapper.properties, plus guidance onandroid.builtInKotlin=false,android.newDsl=false, and--android-skip-build-dependency-validation.Important
Open question before marking ready for review:
Under
## Background, the page links the Android dependency versions support policy ("warn for at least one stable release before raising the minimum"). In Flutter 3.50, AGP9.0.1–9.1.0, Gradle9.1.0–9.3.0, and KGP2.3.20–2.4.9fail validation without a prior warning in Flutter 3.47. Confirm whether to keep the page focused on the 3.50 minimums as written, or add an explicit note that 3.50 made an exception to the warning-cycle policy.Companion PR for the Flutter Gradle Plugin Variant API migration guide:
#14053
Issues fixed by this PR (if any):
None.
PRs or commits this PR depends on (if any):
None.
Presubmit checklist
of 80 characters or fewer.