Fix regression to hardcoded AGP/Kotlin values in Android module templates (#160108)

https://github.com/flutter/flutter/pull/159770 regressed the module
templates to use a hardcoded `8.7.0` and `1.8.22` as the AGP and Kotlin
versions respectively. This PR returns them to using the template
context values.

## 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 `///`).
- [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.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- 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: Gray Mackall <mackall@google.com>
This commit is contained in:
Gray Mackall
2024-12-16 11:59:00 -08:00
committed by GitHub
parent a0f2424e2e
commit b19b68074f
2 changed files with 3 additions and 3 deletions

View File

@@ -20,8 +20,8 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.library" version "8.7.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "com.android.library" version "{{agpVersionForModule}}" apply false
id "org.jetbrains.kotlin.android" version "{{kotlinVersion}}" apply false
}
include ':app'

View File

@@ -164,7 +164,7 @@
"templates/module/android/host_app_common/app.tmpl/src/main/res/mipmap-hdpi/ic_launcher.png",
"templates/module/android/host_app_common/app.tmpl/src/main/res/values/styles.xml",
"templates/module/android/host_app_editable/settings.gradle.copy.tmpl",
"templates/module/android/host_app_ephemeral/settings.gradle.copy.tmpl",
"templates/module/android/host_app_ephemeral/settings.gradle.tmpl",
"templates/module/android/library/Flutter.tmpl/build.gradle.tmpl",
"templates/module/android/library/Flutter.tmpl/flutter.iml.copy.tmpl",
"templates/module/android/library/Flutter.tmpl/src/main/AndroidManifest.xml.tmpl",