From b19b68074fe33ff6593d4f7b335e42326ee00608 Mon Sep 17 00:00:00 2001 From: Gray Mackall <34871572+gmackall@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:59:00 -0800 Subject: [PATCH] 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]. [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 --- .../{settings.gradle.copy.tmpl => settings.gradle.tmpl} | 4 ++-- packages/flutter_tools/templates/template_manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename packages/flutter_tools/templates/module/android/host_app_ephemeral/{settings.gradle.copy.tmpl => settings.gradle.tmpl} (83%) diff --git a/packages/flutter_tools/templates/module/android/host_app_ephemeral/settings.gradle.copy.tmpl b/packages/flutter_tools/templates/module/android/host_app_ephemeral/settings.gradle.tmpl similarity index 83% rename from packages/flutter_tools/templates/module/android/host_app_ephemeral/settings.gradle.copy.tmpl rename to packages/flutter_tools/templates/module/android/host_app_ephemeral/settings.gradle.tmpl index 4498ec041eb74..0516b65aae796 100644 --- a/packages/flutter_tools/templates/module/android/host_app_ephemeral/settings.gradle.copy.tmpl +++ b/packages/flutter_tools/templates/module/android/host_app_ephemeral/settings.gradle.tmpl @@ -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' diff --git a/packages/flutter_tools/templates/template_manifest.json b/packages/flutter_tools/templates/template_manifest.json index 62bd63c3f8ec7..70b73ae56e57a 100644 --- a/packages/flutter_tools/templates/template_manifest.json +++ b/packages/flutter_tools/templates/template_manifest.json @@ -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",