Skip to content

[all_packages] Bump compileSdk version to 35 #9168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 2 additions & 44 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,69 +395,27 @@ targets:
properties:
version_file: flutter_master.version
# This builds the all_packages app only in a current JDK.
target_file: android_build_all_packages_jdk17.yaml
target_file: android_build_all_packages.yaml
channel: master
env_variables: >-
{
"CHANNEL": "master"
}

- name: Linux_android android_build_all_packages_legacy master
recipe: packages/packages
timeout: 30
properties:
version_file: flutter_master.version
# TODO(stuartmorgan): Once stable requires JDK 17, and the
# legacy project is updated accordingly, this entire target
# can be merged back into android_build_all_packages.
# This file only builds a *legacy* version of the project.
target_file: android_build_all_packages_legacy.yaml
channel: master
# The legacy project build requires an older JDK.
dependencies: >-
[
{"dependency": "open_jdk", "version": "version:11"}
]
env_variables: >-
{
"CHANNEL": "master"
}

- name: Linux_android android_build_all_packages stable
recipe: packages/packages
timeout: 30
properties:
add_recipes_cq: "true"
version_file: flutter_stable.version
# This builds the all_packages app only in a current JDK.
target_file: android_build_all_packages_jdk17.yaml
target_file: android_build_all_packages.yaml
channel: stable
env_variables: >-
{
"CHANNEL": "stable"
}

- name: Linux_android android_build_all_packages_legacy stable
# Temporarily disabled to unblock roll to 3.32.
# See https://github.com/flutter/flutter/issues/169290
bringup: true
recipe: packages/packages
timeout: 30
properties:
version_file: flutter_stable.version
# This file only builds a *legacy* version of the project.
target_file: android_build_all_packages_legacy.yaml
channel: stable
# The legacy project build requires an older JDK.
dependencies: >-
[
{"dependency": "open_jdk", "version": "version:11"}
]
env_variables: >-
{
"CHANNEL": "stable"
}

- name: Linux_android android_platform_tests_shard_1 master
recipe: packages/packages
timeout: 60
Expand Down
23 changes: 12 additions & 11 deletions .ci/legacy_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ and then deleting everything but `android/` from it:
- Added license boilerplate.
- Replaced `jcenter` in build.gradle with `mavenCentral`, due to the
jcenter.bintray.com shutdown.
- Update `compileSdkVersion` from 30 to 33 to maintain compatibility
with plugins that use API 34.
- 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.
- Update `compileSdkVersion` from 30 to `flutter.compileSdkVersion` in
`build.gradle` to maintain compatibility with plugins that use
Flutter's most recently supported API version.
- 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
from 6.7 to 8.4. 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.
one that we support.
- Modifies `settings.gradle` to upgrade the Android Gradle Plugin (AGP)
from version 4.1.0 (originally set in `build.gradle`; see bullet below)
to 8.3.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.
- Refactor plugin to use declarative Gradle apply instead of the
imperative apply (this includes moving where the Android Gradle
Plugin (AGP) version is set from `build.gradle` to `settings.gradle`).
Original file line number Diff line number Diff line change
Expand Up @@ -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-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
2 changes: 1 addition & 1 deletion .ci/legacy_project/all_packages/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
// See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info.
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.0.0" apply false
id "com.android.application" version "8.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# This only builds the legacy all_packages app, which requires jdk11
# This builds the modern all_packages app and the legacy all_packages app.
tasks:
- name: prepare tool
script: .ci/scripts/prepare_tool.sh
infra_step: true # Note infra steps failing prevents "always" from running.
- name: create all_packages app
script: .ci/scripts/create_all_packages_app.sh
infra_step: true # Note infra steps failing prevents "always" from running.
- name: build all_packages for Android debug
script: .ci/scripts/build_all_packages_app.sh
args: ["apk", "debug"]
- name: build all_packages for Android release
script: .ci/scripts/build_all_packages_app.sh
args: ["apk", "release"]
- name: create all_packages app - legacy version
script: .ci/scripts/create_all_packages_app_legacy.sh
# Output dir; must match the final argument to build_all_packages_app_legacy
Expand Down
14 changes: 0 additions & 14 deletions .ci/targets/android_build_all_packages_jdk17.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions script/tool/lib/src/create_all_packages_app_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ dependencies {}
gradleFile,
replacements: <String, List<String>>{
if (gradleFileIsKotlin)
'compileSdk': <String>['compileSdk = 34']
'compileSdk': <String>['compileSdk = 35']
else ...<String, List<String>>{
'compileSdkVersion': <String>['compileSdk 34'],
'compileSdkVersion': <String>['compileSdk 35'],
}
},
regexReplacements: <RegExp, List<String>>{
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/create_all_packages_app_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ android {
buildGradle,
containsAll(<Matcher>[
contains('This is the legacy file'),
contains('compileSdk 34'),
contains('compileSdk 35'),
]));
});

Expand Down Expand Up @@ -372,7 +372,7 @@ android {
expect(
buildGradle,
containsAll(<Matcher>[
contains('compileSdk 34'),
contains('compileSdk 35'),
contains('androidx.lifecycle:lifecycle-runtime'),
]));
});
Expand Down