From 080fd7459643cd08a4c05c1afe8f0cecd8e67d45 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:09:50 -0700 Subject: [PATCH] Bump legacy all_packages project AGP version to 7.0.0, Gradle version to 7.0.2 (#6591) Upgrades legacy all_packages project AGP version to 7.0.0 and Gradle version to 7.0.2 as Flutter will begin enforcing supported versions for these Android dependencies. This was prompted by dependabot AGP version upgrades like https://github.com/flutter/packages/pull/6522 that are failing due to a what a clear warning* describes as a potential issue: ``` Warning: Flutter support for your project's Gradle version (6.7.1) will soon be dropped. Please upgrade your Gradle version to a version of at least 7.0.2 soon. Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check. Potential fix: Your project's gradle version is typically defined in the gradle wrapper file. By default, this can be found at /b/s/w/ir/x/w/packages/legacy/all_packages/android/gradle/wrapper/gradle-wrapper.properties. For more information, see https://docs.gradle.org/current/userguide/gradle_wrapper.html. Warning: Flutter support for your project's Android Gradle Plugin version (4.1.0) will soon be dropped. Please upgrade your Android Gradle Plugin version to a version of at least 7.0.0 soon. Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check. Potential fix: Your project's AGP version is typically defined the plugins block of the `settings.gradle` file (/b/s/w/ir/x/w/packages/legacy/all_packages/android/settings.gradle), by a plugin with the id of com.android.application. If you don't see a plugins block, your project was likely created with an older template version. In this case it is most likely defined in the top-level build.gradle file (/b/s/w/ir/x/w/packages/legacy/all_packages/android/build.gradle) by the following line in the dependencies block of the buildscript: "classpath 'com.android.tools.build:gradle:'". ``` Other dependabot upgrades that I believe are blocked by this change: https://github.com/flutter/packages/pull/6585 https://github.com/flutter/packages/pull/6534 https://github.com/flutter/packages/pull/6530 https://github.com/flutter/packages/pull/6528 https://github.com/flutter/packages/pull/6526 *Added in https://github.com/flutter/flutter/pull/143341 --- .ci/legacy_project/README.md | 8 ++++++++ .ci/legacy_project/all_packages/android/build.gradle | 2 +- .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.ci/legacy_project/README.md b/.ci/legacy_project/README.md index 0e23f626fb414..1ee7313e73dd9 100644 --- a/.ci/legacy_project/README.md +++ b/.ci/legacy_project/README.md @@ -42,3 +42,11 @@ and then deleting everything but `android/` from it: - Updates `gradle-wrapper.properties` from `6.7` to `6.7.1`, to add support for the Kotlin gradle plugin. If a user runs into this error, the error message is clear on how to upgrade. +- Modifies `build.gradle` to upgrade the Android Gradle Plugin (AGP) + from version 4.1.0 to 7.0.0. If a user runs into an error with + the AGP version, the warning is clear on how to upgrade + the version to one that we support. +- Modifies `gradle-wrapper.properties` to upgrade the Gradle version + from 6.7.1 to 7.0.2. If a user runs into an error with the Gradle + version, the warning is clear on how to upgrade the version to + one that we support. \ No newline at end of file diff --git a/.ci/legacy_project/all_packages/android/build.gradle b/.ci/legacy_project/all_packages/android/build.gradle index 0b4cf534e0aaf..08cb0aa3de911 100644 --- a/.ci/legacy_project/all_packages/android/build.gradle +++ b/.ci/legacy_project/all_packages/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.0.0' } } diff --git a/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties b/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties index 939efa2951bf9..b8793d3c0d699 100644 --- a/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties +++ b/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip