From 7730f290241fc26b62584c5aaebe1618e04b8c6d Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:45:25 +0000 Subject: [PATCH] Reverts "Update template/test `compileSdk`, `targetSdk`, `ndk` versions (#152487)" (#153793) Reverts: flutter/flutter#152487 Initiated by: gmackall Reason for reverting: I forgot that I need to override the compileSdkVersion in the AGP 8.0 [instance of this test](https://github.com/flutter/flutter/blob/ef9cd32f5a2c0e27300fb9f4662d11da976087d7/dev/devicelab/bin/tasks/android_java17_dependency_smoke_tests.dart#L19) Original PR Author: gmackall Reviewed By: {reidbaker} This change reverts the following previous change: Updates `compileSdk`, `targetSdk`, and `ndk` versions (former 2 to latest, latter to the version of the ndk we are hosting on CIPD). Summary of changes: - Updates mentioned template values - `compileSdk` 35 requires AGP 8.0+, so updated to 8.1 in many places. - This also necessitated Gradle upgrades in most places - This also necessitated moving the `package` xml attribute to the AGP `namespace` field in a couple places (test + template). - Some tests use the output of `flutter create` but then use intentionally lower AGP versions. [I downgraded the `compileSdk` in these tests.](https://github.com/flutter/flutter/pull/152487/commits/fee34fd61a1825625ec89f5c323b35cb83143c53) - [Stopped lockfile generation](https://github.com/flutter/flutter/pull/152487/commits/82324a25708f7224a2e949b05d30e1c5b7361063) script from hitting the `hello_world` example because it uses `.kts` gradle files. - One test needed [some Gradle options we had already added to templates](https://github.com/flutter/flutter/pull/152487/commits/6aa187b4b6f332ed2e7be3e772fe239fbab463b9). --- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../microbenchmarks/android/settings.gradle | 4 +- .../multiple_flutters/android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- ...android_java11_dependency_smoke_tests.dart | 14 +- dev/devicelab/bin/tasks/module_test.dart | 4 +- ...dependency_smoke_test_task_definition.dart | 10 - .../SampleApp/build.gradle | 1 - .../SampleApp/src/main/AndroidManifest.xml | 3 +- .../android_custom_host_app/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../android_driver_test/android/build.gradle | 16 +- .../android/settings.gradle | 18 +- .../app/build.gradle | 1 - .../app/src/main/AndroidManifest.xml | 3 +- .../build.gradle | 2 +- .../android/build.gradle | 4 +- .../android/component1/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../external_textures/android/settings.gradle | 4 +- .../android/buildscript-gradle.lockfile | 154 ++++++++------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../android/project-app.lockfile | 8 + .../flutter_gallery/android/settings.gradle | 2 +- .../app/build.gradle | 1 - .../app/src/main/AndroidManifest.xml | 3 +- .../build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- dev/tools/bin/config/lockfile_exclusion.yaml | 14 +- dev/tracing_tests/android/app/build.gradle | 1 - .../android/app/src/main/AndroidManifest.xml | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- dev/tracing_tests/android/settings.gradle | 4 +- .../android/buildscript-gradle.lockfile | 180 +++++++++--------- .../hello_world/android/project-app.lockfile | 8 + .../hello_world/android/settings.gradle.kts | 4 +- .../gradle/src/main/groovy/flutter.groovy | 6 +- .../lib/src/android/gradle_errors.dart | 24 --- .../lib/src/android/gradle_utils.dart | 6 +- packages/flutter_tools/lib/src/project.dart | 46 +++-- .../deferred_component/build.gradle.tmpl | 1 - .../src/main/AndroidManifest.xml.tmpl | 3 +- ...roid_dependency_version_checking_test.dart | 5 - .../android/gradle_errors_test.dart | 46 ----- ...d_gradle_deprecated_plugin_apply_test.dart | 4 +- .../test_data/deferred_components_config.dart | 9 +- .../deferred_components_project.dart | 17 +- .../test_data/plugin_project.dart | 7 +- .../test/src/android_common.dart | 10 - .../integration_test/android/build.gradle | 7 +- 51 files changed, 280 insertions(+), 403 deletions(-) diff --git a/dev/benchmarks/microbenchmarks/android/gradle/wrapper/gradle-wrapper.properties b/dev/benchmarks/microbenchmarks/android/gradle/wrapper/gradle-wrapper.properties index 5e6b542711..e1ca574ef0 100644 --- a/dev/benchmarks/microbenchmarks/android/gradle/wrapper/gradle-wrapper.properties +++ b/dev/benchmarks/microbenchmarks/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/benchmarks/microbenchmarks/android/settings.gradle b/dev/benchmarks/microbenchmarks/android/settings.gradle index b8866055e0..97b9e7934e 100644 --- a/dev/benchmarks/microbenchmarks/android/settings.gradle +++ b/dev/benchmarks/microbenchmarks/android/settings.gradle @@ -23,8 +23,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false } include ":app" diff --git a/dev/benchmarks/multiple_flutters/android/build.gradle b/dev/benchmarks/multiple_flutters/android/build.gradle index e1a10da492..ea717b215e 100644 --- a/dev/benchmarks/multiple_flutters/android/build.gradle +++ b/dev/benchmarks/multiple_flutters/android/build.gradle @@ -10,7 +10,7 @@ buildscript { mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:8.1.0" + classpath "com.android.tools.build:gradle:7.3.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Do not place your application dependencies here; they belong diff --git a/dev/benchmarks/multiple_flutters/android/gradle/wrapper/gradle-wrapper.properties b/dev/benchmarks/multiple_flutters/android/gradle/wrapper/gradle-wrapper.properties index 372057df29..25c21cc15d 100644 --- a/dev/benchmarks/multiple_flutters/android/gradle/wrapper/gradle-wrapper.properties +++ b/dev/benchmarks/multiple_flutters/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-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/devicelab/bin/tasks/android_java11_dependency_smoke_tests.dart b/dev/devicelab/bin/tasks/android_java11_dependency_smoke_tests.dart index 3c6ef264ca..df1c6ad115 100644 --- a/dev/devicelab/bin/tasks/android_java11_dependency_smoke_tests.dart +++ b/dev/devicelab/bin/tasks/android_java11_dependency_smoke_tests.dart @@ -25,22 +25,14 @@ List versionTuples = [ // This test requires a Java version less than 17 due to the intentionally low // version of Gradle. We choose 11 because this was the primary version used in -// CI before 17, and hence it is also hosted on CIPD. It also overrides to -// compileSdkVersion 34 because compileSdk 35 requires AGP 8.0+. +// CI before 17, and hence it is also hosted on CIPD. // https://docs.gradle.org/current/userguide/compatibility.html Future main() async { /// The [FileSystem] for the integration test environment. const LocalFileSystem fileSystem = LocalFileSystem(); - final Directory tempDir = fileSystem - .systemTempDirectory - .createTempSync('flutter_android_dependency_version_tests'); + final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_android_dependency_version_tests'); await task(() { - return buildFlutterApkWithSpecifiedDependencyVersions( - versionTuples: versionTuples, - compileSdkOverride: '34', - tempDir: tempDir, - localFileSystem: fileSystem - ); + return buildFlutterApkWithSpecifiedDependencyVersions(versionTuples: versionTuples, tempDir: tempDir, localFileSystem: fileSystem); }); } diff --git a/dev/devicelab/bin/tasks/module_test.dart b/dev/devicelab/bin/tasks/module_test.dart index 84118421ec..4b31487e4b 100644 --- a/dev/devicelab/bin/tasks/module_test.dart +++ b/dev/devicelab/bin/tasks/module_test.dart @@ -449,7 +449,7 @@ class ModuleTest { Future main() async { await task(combine([ // ignore: avoid_redundant_argument_values - ModuleTest('module-gradle-7.6', gradleVersion: '8.4').call, - ModuleTest('module-gradle-7.6', gradleVersion: '8.4-rc-3').call, + ModuleTest('module-gradle-7.6', gradleVersion: '7.6.3').call, + ModuleTest('module-gradle-7.6', gradleVersion: '7.6-rc-2').call, ])); } diff --git a/dev/devicelab/lib/framework/dependency_smoke_test_task_definition.dart b/dev/devicelab/lib/framework/dependency_smoke_test_task_definition.dart index bf3c4be83b..207da50318 100644 --- a/dev/devicelab/lib/framework/dependency_smoke_test_task_definition.dart +++ b/dev/devicelab/lib/framework/dependency_smoke_test_task_definition.dart @@ -58,7 +58,6 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-GRADLE_REPLACE '''; const String gradleReplacementString = 'GRADLE_REPLACE_ME'; -const String flutterCompileSdkString = 'flutter.compileSdkVersion'; /// A simple class containing a Kotlin, Gradle, and AGP version. class VersionTuple { @@ -88,7 +87,6 @@ class VersionTuple { /// fails, returns a successful result otherwise. Cleans up in either case. Future buildFlutterApkWithSpecifiedDependencyVersions({ required List versionTuples, - String? compileSdkOverride, required Directory tempDir, required LocalFileSystem localFileSystem,}) async { for (final VersionTuple versions in versionTuples) { @@ -107,14 +105,6 @@ Future buildFlutterApkWithSpecifiedDependencyVersions({ final String appPath = '${innerTempDir.absolute.path}/dependency_checker_app'; - if (compileSdkOverride != null) { - final File appGradleBuild = localFileSystem.file(localFileSystem.path.join( - appPath, 'android', 'app', 'build.gradle')); - final String appBuildContent = appGradleBuild.readAsStringSync() - .replaceFirst(flutterCompileSdkString, compileSdkOverride); - appGradleBuild.writeAsStringSync(appBuildContent); - } - // Modify gradle version to passed in version. final File gradleWrapperProperties = localFileSystem.file(localFileSystem.path.join( appPath, 'android', 'gradle', 'wrapper', 'gradle-wrapper.properties')); diff --git a/dev/integration_tests/android_custom_host_app/SampleApp/build.gradle b/dev/integration_tests/android_custom_host_app/SampleApp/build.gradle index 1ec1e7bc65..a6d113aee4 100644 --- a/dev/integration_tests/android_custom_host_app/SampleApp/build.gradle +++ b/dev/integration_tests/android_custom_host_app/SampleApp/build.gradle @@ -5,7 +5,6 @@ apply plugin: 'com.android.application' android { - namespace = "io.flutter.add2app" compileSdk 34 compileOptions { diff --git a/dev/integration_tests/android_custom_host_app/SampleApp/src/main/AndroidManifest.xml b/dev/integration_tests/android_custom_host_app/SampleApp/src/main/AndroidManifest.xml index 6a73e6c126..2f3b2713cd 100644 --- a/dev/integration_tests/android_custom_host_app/SampleApp/src/main/AndroidManifest.xml +++ b/dev/integration_tests/android_custom_host_app/SampleApp/src/main/AndroidManifest.xml @@ -3,7 +3,8 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> + xmlns:tools="http://schemas.android.com/tools" + package="io.flutter.add2app"> diff --git a/dev/integration_tests/android_custom_host_app/build.gradle b/dev/integration_tests/android_custom_host_app/build.gradle index 592d125fbc..90455ea0ad 100644 --- a/dev/integration_tests/android_custom_host_app/build.gradle +++ b/dev/integration_tests/android_custom_host_app/build.gradle @@ -8,7 +8,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' } } diff --git a/dev/integration_tests/android_custom_host_app/gradle/wrapper/gradle-wrapper.properties b/dev/integration_tests/android_custom_host_app/gradle/wrapper/gradle-wrapper.properties index 5e6b542711..e1ca574ef0 100644 --- a/dev/integration_tests/android_custom_host_app/gradle/wrapper/gradle-wrapper.properties +++ b/dev/integration_tests/android_custom_host_app/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/integration_tests/android_driver_test/android/build.gradle b/dev/integration_tests/android_driver_test/android/build.gradle index bedac9d2d4..96ac13cda7 100644 --- a/dev/integration_tests/android_driver_test/android/build.gradle +++ b/dev/integration_tests/android_driver_test/android/build.gradle @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file is auto generated. -// To update all the build.gradle files in the Flutter repo, -// See dev/tools/bin/generate_gradle_lockfiles.dart. - allprojects { repositories { google() @@ -13,20 +9,12 @@ allprojects { } } -rootProject.buildDir = '../build' - +rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { - project.evaluationDependsOn(':app') - dependencyLocking { - ignoredDependencies.add('io.flutter:*') - lockFile = file("${rootProject.projectDir}/project-${project.name}.lockfile") - if (!project.hasProperty('local-engine-repo')) { - lockAllConfigurations() - } - } + project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { diff --git a/dev/integration_tests/android_driver_test/android/settings.gradle b/dev/integration_tests/android_driver_test/android/settings.gradle index 73a4cf75b6..9f47aeeecb 100644 --- a/dev/integration_tests/android_driver_test/android/settings.gradle +++ b/dev/integration_tests/android_driver_test/android/settings.gradle @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file is auto generated. -// To update all the settings.gradle files in the Flutter repo, -// See dev/tools/bin/generate_gradle_lockfiles.dart. - pluginManagement { def flutterSdkPath = { def properties = new Properties() @@ -13,10 +9,9 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { google() @@ -25,17 +20,10 @@ pluginManagement { } } -buildscript { - dependencyLocking { - lockFile = file("${rootProject.projectDir}/buildscript-gradle.lockfile") - lockAllConfigurations() - } -} - plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false } include ":app" diff --git a/dev/integration_tests/android_host_app_v2_embedding/app/build.gradle b/dev/integration_tests/android_host_app_v2_embedding/app/build.gradle index 71abced98b..9476474f25 100644 --- a/dev/integration_tests/android_host_app_v2_embedding/app/build.gradle +++ b/dev/integration_tests/android_host_app_v2_embedding/app/build.gradle @@ -5,7 +5,6 @@ apply plugin: 'com.android.application' android { - namespace = "io.flutter.add2app" compileSdk 34 compileOptions { diff --git a/dev/integration_tests/android_host_app_v2_embedding/app/src/main/AndroidManifest.xml b/dev/integration_tests/android_host_app_v2_embedding/app/src/main/AndroidManifest.xml index 6a73e6c126..2f3b2713cd 100644 --- a/dev/integration_tests/android_host_app_v2_embedding/app/src/main/AndroidManifest.xml +++ b/dev/integration_tests/android_host_app_v2_embedding/app/src/main/AndroidManifest.xml @@ -3,7 +3,8 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> + xmlns:tools="http://schemas.android.com/tools" + package="io.flutter.add2app"> diff --git a/dev/integration_tests/android_host_app_v2_embedding/build.gradle b/dev/integration_tests/android_host_app_v2_embedding/build.gradle index 592d125fbc..90455ea0ad 100644 --- a/dev/integration_tests/android_host_app_v2_embedding/build.gradle +++ b/dev/integration_tests/android_host_app_v2_embedding/build.gradle @@ -8,7 +8,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' } } diff --git a/dev/integration_tests/deferred_components_test/android/build.gradle b/dev/integration_tests/deferred_components_test/android/build.gradle index dbed9170e9..e6a483e244 100644 --- a/dev/integration_tests/deferred_components_test/android/build.gradle +++ b/dev/integration_tests/deferred_components_test/android/build.gradle @@ -7,14 +7,14 @@ // See dev/tools/bin/generate_gradle_lockfiles.dart. buildscript { - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } diff --git a/dev/integration_tests/deferred_components_test/android/component1/build.gradle b/dev/integration_tests/deferred_components_test/android/component1/build.gradle index b919b5b3bc..1f20e08f0e 100644 --- a/dev/integration_tests/deferred_components_test/android/component1/build.gradle +++ b/dev/integration_tests/deferred_components_test/android/component1/build.gradle @@ -24,7 +24,7 @@ apply plugin: "com.android.dynamic-feature" android { namespace "io.flutter.integration.deferred_components_test.component1" - compileSdk 35 + compileSdk 34 sourceSets { applicationVariants.all { variant -> @@ -35,7 +35,7 @@ android { defaultConfig { minSdkVersion 21 - targetSdkVersion 35 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/dev/integration_tests/deferred_components_test/android/gradle/wrapper/gradle-wrapper.properties b/dev/integration_tests/deferred_components_test/android/gradle/wrapper/gradle-wrapper.properties index 5e6b542711..e1ca574ef0 100644 --- a/dev/integration_tests/deferred_components_test/android/gradle/wrapper/gradle-wrapper.properties +++ b/dev/integration_tests/deferred_components_test/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/integration_tests/external_textures/android/gradle/wrapper/gradle-wrapper.properties b/dev/integration_tests/external_textures/android/gradle/wrapper/gradle-wrapper.properties index 5e6b542711..e1ca574ef0 100644 --- a/dev/integration_tests/external_textures/android/gradle/wrapper/gradle-wrapper.properties +++ b/dev/integration_tests/external_textures/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/integration_tests/external_textures/android/settings.gradle b/dev/integration_tests/external_textures/android/settings.gradle index cbe8cd337e..30db20e260 100644 --- a/dev/integration_tests/external_textures/android/settings.gradle +++ b/dev/integration_tests/external_textures/android/settings.gradle @@ -34,8 +34,8 @@ buildscript { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false } include ":app" diff --git a/dev/integration_tests/flutter_gallery/android/buildscript-gradle.lockfile b/dev/integration_tests/flutter_gallery/android/buildscript-gradle.lockfile index c4ae49fa77..7e31538970 100644 --- a/dev/integration_tests/flutter_gallery/android/buildscript-gradle.lockfile +++ b/dev/integration_tests/flutter_gallery/android/buildscript-gradle.lockfile @@ -1,68 +1,65 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -androidx.databinding:databinding-common:8.1.0=classpath -androidx.databinding:databinding-compiler-common:8.1.0=classpath -com.android.application:com.android.application.gradle.plugin:8.1.0=classpath -com.android.databinding:baseLibrary:8.1.0=classpath -com.android.tools.analytics-library:crash:31.1.0=classpath -com.android.tools.analytics-library:protos:31.1.0=classpath -com.android.tools.analytics-library:shared:31.1.0=classpath -com.android.tools.analytics-library:tracker:31.1.0=classpath +androidx.databinding:databinding-common:7.3.0=classpath +androidx.databinding:databinding-compiler-common:7.3.0=classpath +com.android.application:com.android.application.gradle.plugin:7.3.0=classpath +com.android.databinding:baseLibrary:7.3.0=classpath +com.android.tools.analytics-library:crash:30.3.0=classpath +com.android.tools.analytics-library:protos:30.3.0=classpath +com.android.tools.analytics-library:shared:30.3.0=classpath +com.android.tools.analytics-library:tracker:30.3.0=classpath com.android.tools.build.jetifier:jetifier-core:1.0.0-beta10=classpath com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta10=classpath -com.android.tools.build:aapt2-proto:8.1.0-10154469=classpath -com.android.tools.build:aaptcompiler:8.1.0=classpath -com.android.tools.build:apksig:8.1.0=classpath -com.android.tools.build:apkzlib:8.1.0=classpath -com.android.tools.build:builder-model:8.1.0=classpath -com.android.tools.build:builder-test-api:8.1.0=classpath -com.android.tools.build:builder:8.1.0=classpath -com.android.tools.build:bundletool:1.14.0=classpath -com.android.tools.build:gradle-api:8.1.0=classpath -com.android.tools.build:gradle-settings-api:8.1.0=classpath -com.android.tools.build:gradle:8.1.0=classpath -com.android.tools.build:manifest-merger:31.1.0=classpath +com.android.tools.build:aapt2-proto:7.3.0-8691043=classpath +com.android.tools.build:aaptcompiler:7.3.0=classpath +com.android.tools.build:apksig:7.3.0=classpath +com.android.tools.build:apkzlib:7.3.0=classpath +com.android.tools.build:builder-model:7.3.0=classpath +com.android.tools.build:builder-test-api:7.3.0=classpath +com.android.tools.build:builder:7.3.0=classpath +com.android.tools.build:bundletool:1.9.0=classpath +com.android.tools.build:gradle-api:7.3.0=classpath +com.android.tools.build:gradle:7.3.0=classpath +com.android.tools.build:manifest-merger:30.3.0=classpath com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api=classpath -com.android.tools.ddms:ddmlib:31.1.0=classpath -com.android.tools.layoutlib:layoutlib-api:31.1.0=classpath -com.android.tools.lint:lint-model:31.1.0=classpath -com.android.tools.lint:lint-typedef-remover:31.1.0=classpath -com.android.tools.utp:android-device-provider-ddmlib-proto:31.1.0=classpath -com.android.tools.utp:android-device-provider-gradle-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-host-apk-installer-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-host-coverage-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-host-emulator-control-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-host-logcat-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-host-retention-proto:31.1.0=classpath -com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.1.0=classpath -com.android.tools:annotations:31.1.0=classpath -com.android.tools:common:31.1.0=classpath -com.android.tools:dvlib:31.1.0=classpath -com.android.tools:repository:31.1.0=classpath -com.android.tools:sdk-common:31.1.0=classpath -com.android.tools:sdklib:31.1.0=classpath -com.android:signflinger:8.1.0=classpath -com.android:zipflinger:8.1.0=classpath +com.android.tools.ddms:ddmlib:30.3.0=classpath +com.android.tools.layoutlib:layoutlib-api:30.3.0=classpath +com.android.tools.lint:lint-model:30.3.0=classpath +com.android.tools.lint:lint-typedef-remover:30.3.0=classpath +com.android.tools.utp:android-device-provider-ddmlib-proto:30.3.0=classpath +com.android.tools.utp:android-device-provider-gradle-proto:30.3.0=classpath +com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:30.3.0=classpath +com.android.tools.utp:android-test-plugin-host-coverage-proto:30.3.0=classpath +com.android.tools.utp:android-test-plugin-host-retention-proto:30.3.0=classpath +com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.3.0=classpath +com.android.tools:annotations:30.3.0=classpath +com.android.tools:common:30.3.0=classpath +com.android.tools:dvlib:30.3.0=classpath +com.android.tools:repository:30.3.0=classpath +com.android.tools:sdk-common:30.3.0=classpath +com.android.tools:sdklib:30.3.0=classpath +com.android:signflinger:7.3.0=classpath +com.android:zipflinger:7.3.0=classpath com.github.gundy:semver4j:0.16.4=classpath com.google.android:annotations:4.1.1.4=classpath com.google.api.grpc:proto-google-common-protos:2.0.1=classpath com.google.auto.value:auto-value-annotations:1.6.2=classpath com.google.code.findbugs:jsr305:3.0.2=classpath com.google.code.gson:gson:2.8.9=classpath -com.google.crypto.tink:tink:1.7.0=classpath +com.google.crypto.tink:tink:1.3.0-rc2=classpath com.google.dagger:dagger:2.28.3=classpath -com.google.errorprone:error_prone_annotations:2.11.0=classpath +com.google.errorprone:error_prone_annotations:2.4.0=classpath com.google.flatbuffers:flatbuffers-java:1.12.0=classpath com.google.guava:failureaccess:1.0.1=classpath -com.google.guava:guava:31.1-jre=classpath +com.google.guava:guava:30.1-jre=classpath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=classpath com.google.j2objc:j2objc-annotations:1.3=classpath com.google.jimfs:jimfs:1.1=classpath -com.google.protobuf:protobuf-java-util:3.19.3=classpath -com.google.protobuf:protobuf-java:3.19.3=classpath -com.google.testing.platform:core-proto:0.0.8-alpha08=classpath +com.google.protobuf:protobuf-java-util:3.17.2=classpath +com.google.protobuf:protobuf-java:3.17.2=classpath +com.google.testing.platform:core-proto:0.0.8-alpha07=classpath +com.googlecode.json-simple:json-simple:1.1=classpath com.googlecode.juniversalchardet:juniversalchardet:1.0.3=classpath com.squareup:javapoet:1.10.0=classpath com.squareup:javawriter:2.5.0=classpath @@ -73,25 +70,25 @@ commons-codec:commons-codec:1.11=classpath commons-io:commons-io:2.4=classpath commons-logging:commons-logging:1.2=classpath de.undercouch:gradle-download-task:4.1.1=classpath -io.grpc:grpc-api:1.45.1=classpath -io.grpc:grpc-context:1.45.1=classpath -io.grpc:grpc-core:1.45.1=classpath -io.grpc:grpc-netty:1.45.1=classpath -io.grpc:grpc-protobuf-lite:1.45.1=classpath -io.grpc:grpc-protobuf:1.45.1=classpath -io.grpc:grpc-stub:1.45.1=classpath -io.netty:netty-buffer:4.1.72.Final=classpath -io.netty:netty-codec-http2:4.1.72.Final=classpath -io.netty:netty-codec-http:4.1.72.Final=classpath -io.netty:netty-codec-socks:4.1.72.Final=classpath -io.netty:netty-codec:4.1.72.Final=classpath -io.netty:netty-common:4.1.72.Final=classpath -io.netty:netty-handler-proxy:4.1.72.Final=classpath -io.netty:netty-handler:4.1.72.Final=classpath -io.netty:netty-resolver:4.1.72.Final=classpath -io.netty:netty-tcnative-classes:2.0.46.Final=classpath -io.netty:netty-transport:4.1.72.Final=classpath +io.grpc:grpc-api:1.39.0=classpath +io.grpc:grpc-context:1.39.0=classpath +io.grpc:grpc-core:1.39.0=classpath +io.grpc:grpc-netty:1.39.0=classpath +io.grpc:grpc-protobuf-lite:1.39.0=classpath +io.grpc:grpc-protobuf:1.39.0=classpath +io.grpc:grpc-stub:1.39.0=classpath +io.netty:netty-buffer:4.1.52.Final=classpath +io.netty:netty-codec-http2:4.1.52.Final=classpath +io.netty:netty-codec-http:4.1.52.Final=classpath +io.netty:netty-codec-socks:4.1.52.Final=classpath +io.netty:netty-codec:4.1.52.Final=classpath +io.netty:netty-common:4.1.52.Final=classpath +io.netty:netty-handler-proxy:4.1.52.Final=classpath +io.netty:netty-handler:4.1.52.Final=classpath +io.netty:netty-resolver:4.1.52.Final=classpath +io.netty:netty-transport:4.1.52.Final=classpath io.perfmark:perfmark-api:0.23.0=classpath +it.unimi.dsi:fastutil:8.4.0=classpath jakarta.activation:jakarta.activation-api:1.2.1=classpath jakarta.xml.bind:jakarta.xml.bind-api:2.3.2=classpath javax.annotation:javax.annotation-api:1.3.2=classpath @@ -100,14 +97,14 @@ net.java.dev.jna:jna-platform:5.6.0=classpath net.java.dev.jna:jna:5.6.0=classpath net.sf.jopt-simple:jopt-simple:4.9=classpath net.sf.kxml:kxml2:2.3.0=classpath -org.apache.commons:commons-compress:1.21=classpath +org.apache.commons:commons-compress:1.20=classpath org.apache.httpcomponents:httpclient:4.5.13=classpath -org.apache.httpcomponents:httpcore:4.4.15=classpath +org.apache.httpcomponents:httpcore:4.4.13=classpath org.apache.httpcomponents:httpmime:4.5.6=classpath org.bitbucket.b_c:jose4j:0.7.0=classpath org.bouncycastle:bcpkix-jdk15on:1.67=classpath org.bouncycastle:bcprov-jdk15on:1.67=classpath -org.checkerframework:checker-qual:3.12.0=classpath +org.checkerframework:checker-qual:3.5.0=classpath org.codehaus.mojo:animal-sniffer-annotations:1.19=classpath org.glassfish.jaxb:jaxb-runtime:2.3.2=classpath org.glassfish.jaxb:txw2:2.3.2=classpath @@ -128,27 +125,28 @@ org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10=classpath org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.7.10=classpath org.jetbrains.kotlin:kotlin-native-utils:1.7.10=classpath org.jetbrains.kotlin:kotlin-project-model:1.7.10=classpath -org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC2=classpath +org.jetbrains.kotlin:kotlin-reflect:1.5.31=classpath org.jetbrains.kotlin:kotlin-scripting-common:1.7.10=classpath org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10=classpath org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10=classpath org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10=classpath -org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20-RC2=classpath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20-RC2=classpath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20-RC2=classpath -org.jetbrains.kotlin:kotlin-stdlib:1.8.20-RC2=classpath +org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31=classpath +org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31=classpath +org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31=classpath +org.jetbrains.kotlin:kotlin-stdlib:1.5.31=classpath org.jetbrains.kotlin:kotlin-tooling-core:1.7.10=classpath org.jetbrains.kotlin:kotlin-tooling-metadata:1.7.10=classpath org.jetbrains.kotlin:kotlin-util-io:1.7.10=classpath org.jetbrains.kotlin:kotlin-util-klib:1.7.10=classpath org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=classpath org.jetbrains:annotations:13.0=classpath +org.json:json:20180813=classpath org.jvnet.staxex:stax-ex:1.8.1=classpath -org.ow2.asm:asm-analysis:9.2=classpath -org.ow2.asm:asm-commons:9.2=classpath -org.ow2.asm:asm-tree:9.2=classpath -org.ow2.asm:asm-util:9.2=classpath -org.ow2.asm:asm:9.2=classpath +org.ow2.asm:asm-analysis:9.1=classpath +org.ow2.asm:asm-commons:9.1=classpath +org.ow2.asm:asm-tree:9.1=classpath +org.ow2.asm:asm-util:9.1=classpath +org.ow2.asm:asm:9.1=classpath org.slf4j:slf4j-api:1.7.30=classpath org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2=classpath xerces:xercesImpl:2.12.0=classpath diff --git a/dev/integration_tests/flutter_gallery/android/gradle/wrapper/gradle-wrapper.properties b/dev/integration_tests/flutter_gallery/android/gradle/wrapper/gradle-wrapper.properties index 5e6b542711..e1ca574ef0 100644 --- a/dev/integration_tests/flutter_gallery/android/gradle/wrapper/gradle-wrapper.properties +++ b/dev/integration_tests/flutter_gallery/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/integration_tests/flutter_gallery/android/project-app.lockfile b/dev/integration_tests/flutter_gallery/android/project-app.lockfile index bbe08c11a9..e179bb1207 100644 --- a/dev/integration_tests/flutter_gallery/android/project-app.lockfile +++ b/dev/integration_tests/flutter_gallery/android/project-app.lockfile @@ -67,6 +67,10 @@ org.checkerframework:checker-qual:3.41.0=debugRuntimeClasspath,debugUnitTestRunt org.hamcrest:hamcrest-core:1.3=debugAndroidTestCompileClasspath,debugAndroidTestRuntimeClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath org.hamcrest:hamcrest-integration:1.3=debugAndroidTestCompileClasspath,debugAndroidTestRuntimeClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath org.hamcrest:hamcrest-library:1.3=debugAndroidTestCompileClasspath,debugAndroidTestRuntimeClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.7=androidJacocoAnt +org.jacoco:org.jacoco.ant:0.8.7=androidJacocoAnt +org.jacoco:org.jacoco.core:0.8.7=androidJacocoAnt +org.jacoco:org.jacoco.report:0.8.7=androidJacocoAnt org.jetbrains.kotlin:kotlin-bom:1.8.22=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,profileRuntimeClasspath,profileUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22=debugAndroidTestCompileClasspath,debugAndroidTestRuntimeClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20=debugAndroidTestCompileClasspath @@ -79,4 +83,8 @@ org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.1=debugAndroidTestCompileClassp org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath org.jetbrains:annotations:23.0.0=debugAndroidTestCompileClasspath,debugAndroidTestRuntimeClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,profileCompileClasspath,profileRuntimeClasspath,profileUnitTestCompileClasspath,profileUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath +org.ow2.asm:asm-analysis:9.1=androidJacocoAnt +org.ow2.asm:asm-commons:9.1=androidJacocoAnt +org.ow2.asm:asm-tree:9.1=androidJacocoAnt +org.ow2.asm:asm:9.1=androidJacocoAnt empty=androidApis,androidJdkImage,androidTestUtil,coreLibraryDesugaring,debugAndroidTestAnnotationProcessorClasspath,debugAnnotationProcessorClasspath,debugReverseMetadataValues,debugUnitTestAnnotationProcessorClasspath,debugWearBundling,lintChecks,lintPublish,profileAnnotationProcessorClasspath,profileReverseMetadataValues,profileUnitTestAnnotationProcessorClasspath,profileWearBundling,releaseAnnotationProcessorClasspath,releaseReverseMetadataValues,releaseUnitTestAnnotationProcessorClasspath,releaseWearBundling diff --git a/dev/integration_tests/flutter_gallery/android/settings.gradle b/dev/integration_tests/flutter_gallery/android/settings.gradle index 73a4cf75b6..30db20e260 100644 --- a/dev/integration_tests/flutter_gallery/android/settings.gradle +++ b/dev/integration_tests/flutter_gallery/android/settings.gradle @@ -34,7 +34,7 @@ buildscript { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false + id "com.android.application" version "7.3.0" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/build.gradle b/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/build.gradle index 1e69c1f986..428083d45e 100644 --- a/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/build.gradle +++ b/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/build.gradle @@ -5,7 +5,6 @@ apply plugin: 'com.android.application' android { - namespace = "io.flutter.addtoapp" compileSdk 34 compileOptions { diff --git a/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/src/main/AndroidManifest.xml b/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/src/main/AndroidManifest.xml index 6a73e6c126..dc7d78d0af 100644 --- a/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/src/main/AndroidManifest.xml +++ b/dev/integration_tests/module_host_with_custom_build_v2_embedding/app/src/main/AndroidManifest.xml @@ -3,7 +3,8 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> + xmlns:tools="http://schemas.android.com/tools" + package="io.flutter.addtoapp"> diff --git a/dev/integration_tests/module_host_with_custom_build_v2_embedding/build.gradle b/dev/integration_tests/module_host_with_custom_build_v2_embedding/build.gradle index 592d125fbc..90455ea0ad 100644 --- a/dev/integration_tests/module_host_with_custom_build_v2_embedding/build.gradle +++ b/dev/integration_tests/module_host_with_custom_build_v2_embedding/build.gradle @@ -8,7 +8,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' } } diff --git a/dev/integration_tests/module_host_with_custom_build_v2_embedding/gradle/wrapper/gradle-wrapper.properties b/dev/integration_tests/module_host_with_custom_build_v2_embedding/gradle/wrapper/gradle-wrapper.properties index 5e6b542711..e1ca574ef0 100644 --- a/dev/integration_tests/module_host_with_custom_build_v2_embedding/gradle/wrapper/gradle-wrapper.properties +++ b/dev/integration_tests/module_host_with_custom_build_v2_embedding/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/dev/tools/bin/config/lockfile_exclusion.yaml b/dev/tools/bin/config/lockfile_exclusion.yaml index 3c095a1353..9b942081ed 100644 --- a/dev/tools/bin/config/lockfile_exclusion.yaml +++ b/dev/tools/bin/config/lockfile_exclusion.yaml @@ -2,18 +2,12 @@ # Each exclusion must have an associated reason. Please avoid adding to this list unless necessary, # as each exclusion must be updated by hand. +# flutter_gallery uses discontinued plugins with old AGP versions that block the app itself using +# a newer AGP version. +- dev/integration_tests/flutter_gallery/android + # gradle_deprecated_settings intentionally uses a Gradle file structure matching an old output of # `flutter create`. It must be updated manually, by changing the desired versions in the Gradle # files, and then running `rm buildscript-gradle.lockfile && ./gradlew :generateLockfiles` from # its android subdirectory. - dev/integration_tests/gradle_deprecated_settings/android - -# hello_world uses a Kotlin Gradle settings file (settings.gradle.kts). We don't have a template -# Kotlin Gradle settings file (only a groovy one), so we currently can't generate it. -- examples/hello_world/android - -# The following files must also be manually updated at the moment, because they don't use a -# lib/main.dart (but they don't need exclusion, as we already skip that case). -# dev/benchmarks/microbenchmarks/android/build.gradle -# dev/tracing_tests/android/build.gradle -# dev/integration_tests/external_textures/android/build.gradle diff --git a/dev/tracing_tests/android/app/build.gradle b/dev/tracing_tests/android/app/build.gradle index a3bd4a16a4..5364fad3d4 100644 --- a/dev/tracing_tests/android/app/build.gradle +++ b/dev/tracing_tests/android/app/build.gradle @@ -27,7 +27,6 @@ if (flutterVersionName == null) { } android { - namespace = "com.example.tracing_tests" compileSdk flutter.compileSdkVersion compileOptions { diff --git a/dev/tracing_tests/android/app/src/main/AndroidManifest.xml b/dev/tracing_tests/android/app/src/main/AndroidManifest.xml index 7e9e6176c6..dab8bc6b07 100644 --- a/dev/tracing_tests/android/app/src/main/AndroidManifest.xml +++ b/dev/tracing_tests/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,8 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> - + gradleErrors = [ incompatibleJavaAndGradleVersionsHandler, remoteTerminatedHandshakeHandler, couldNotOpenCacheDirectoryHandler, - incompatibleCompileSdk35AndAgpVersionHandler, ]; const String _boxTitle = 'Flutter Fix'; @@ -641,26 +640,3 @@ final GradleHandledError couldNotOpenCacheDirectoryHandler = GradleHandledError( }, eventLabel: 'could-not-open-cache-directory', ); - -@visibleForTesting -final GradleHandledError incompatibleCompileSdk35AndAgpVersionHandler = GradleHandledError( - test: (String line) => line.contains('RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data'), - handler: ({ - required String line, - required FlutterProject project, - required bool usesAndroidX, - }) async { - globals.printBox( - '${globals.logger.terminal.warningMark} Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher.' - ' \n Please upgrade to a newer AGP version. The version of AGP that your project uses is likely' - " defined in:\n${project.android.settingsGradleFile.path},\nin the 'plugins' closure. \n Alternatively, if your " - 'project was created with an older version of the templates, it is likely \nin the buildscript.dependencies ' - 'closure of the top-level build.gradle:\n${project.android.hostAppGradleFile.path}.\n\n Finally, if you have a' - ' strong reason to avoid upgrading AGP, you can temporarily lower the compileSdk version in the following file:\n${project.android.appGradleFile.path}', - title: _boxTitle, - ); - - return GradleBuildStatus.exit; - }, - eventLabel: 'incompatible-compile-sdk-and-agp', -); diff --git a/packages/flutter_tools/lib/src/android/gradle_utils.dart b/packages/flutter_tools/lib/src/android/gradle_utils.dart index ea6f245a19..d361cb2fd0 100644 --- a/packages/flutter_tools/lib/src/android/gradle_utils.dart +++ b/packages/flutter_tools/lib/src/android/gradle_utils.dart @@ -38,10 +38,10 @@ const String templateKotlinGradlePluginVersion = '1.8.22'; // so new versions are picked up after a Flutter upgrade. // // Please see the README before changing any of these values. -const String compileSdkVersion = '35'; +const String compileSdkVersion = '34'; const String minSdkVersion = '21'; -const String targetSdkVersion = '35'; -const String ndkVersion = '26.1.10909125'; +const String targetSdkVersion = '34'; +const String ndkVersion = '23.1.7779620'; // Update these when new major versions of Java are supported by new Gradle diff --git a/packages/flutter_tools/lib/src/project.dart b/packages/flutter_tools/lib/src/project.dart index 88dc60225a..09cebef724 100644 --- a/packages/flutter_tools/lib/src/project.dart +++ b/packages/flutter_tools/lib/src/project.dart @@ -568,33 +568,22 @@ class AndroidProject extends FlutterProjectPlatform { /// The file must exist and it must be written in either Groovy (build.gradle) /// or Kotlin (build.gradle.kts). File get hostAppGradleFile { - return getGroovyOrKotlin(hostAppGradleRoot, 'build.gradle'); - } + final File buildGroovy = hostAppGradleRoot.childFile('build.gradle'); + final File buildKotlin = hostAppGradleRoot.childFile('build.gradle.kts'); - /// Gets the project root level Gradle settings file. - /// - /// The file must exist and it must be written in either Groovy (build.gradle) - /// or Kotlin (build.gradle.kts). - File get settingsGradleFile { - return getGroovyOrKotlin(hostAppGradleRoot, 'settings.gradle'); - } - - File getGroovyOrKotlin(Directory directory, String baseFilename) { - final File groovyFile = directory.childFile(baseFilename); - final File kotlinFile = directory.childFile('$baseFilename.kts'); - - if (groovyFile.existsSync()) { + if (buildGroovy.existsSync() && buildKotlin.existsSync()) { // We mimic Gradle's behavior of preferring Groovy over Kotlin when both files exist. - return groovyFile; + return buildGroovy; } - if (kotlinFile.existsSync()) { - return kotlinFile; + + if (buildKotlin.existsSync()) { + return buildKotlin; } // TODO(bartekpacia): An exception should be thrown when neither - // the Groovy or Kotlin file exists, instead of falling back to the + // build.gradle nor build.gradle.kts exist, instead of falling back to the // Groovy file. See #141180. - return groovyFile; + return buildGroovy; } /// Gets the module-level build.gradle file. @@ -604,7 +593,22 @@ class AndroidProject extends FlutterProjectPlatform { /// or Kotlin (build.gradle.kts). File get appGradleFile { final Directory appDir = hostAppGradleRoot.childDirectory('app'); - return getGroovyOrKotlin(appDir, 'build.gradle'); + final File buildGroovy = appDir.childFile('build.gradle'); + final File buildKotlin = appDir.childFile('build.gradle.kts'); + + if (buildGroovy.existsSync() && buildKotlin.existsSync()) { + // We mimic Gradle's behavior of preferring Groovy over Kotlin when both files exist. + return buildGroovy; + } + + if (buildKotlin.existsSync()) { + return buildKotlin; + } + + // TODO(bartekpacia): An exception should be thrown when neither + // build.gradle nor build.gradle.kts exist, instead of falling back to the + // Groovy file. See #141180. + return buildGroovy; } File get appManifestFile { diff --git a/packages/flutter_tools/templates/module/android/deferred_component/build.gradle.tmpl b/packages/flutter_tools/templates/module/android/deferred_component/build.gradle.tmpl index 3bc24b0d71..a1f25c81f7 100644 --- a/packages/flutter_tools/templates/module/android/deferred_component/build.gradle.tmpl +++ b/packages/flutter_tools/templates/module/android/deferred_component/build.gradle.tmpl @@ -19,7 +19,6 @@ if (flutterVersionName == null) { apply plugin: "com.android.dynamic-feature" android { - namespace = "{{androidIdentifier}}.{{componentName}}" compileSdk = flutter.compileSdkVersion compileOptions { diff --git a/packages/flutter_tools/templates/module/android/deferred_component/src/main/AndroidManifest.xml.tmpl b/packages/flutter_tools/templates/module/android/deferred_component/src/main/AndroidManifest.xml.tmpl index 60e53e11c5..71fe20f019 100644 --- a/packages/flutter_tools/templates/module/android/deferred_component/src/main/AndroidManifest.xml.tmpl +++ b/packages/flutter_tools/templates/module/android/deferred_component/src/main/AndroidManifest.xml.tmpl @@ -1,5 +1,6 @@ + xmlns:dist="http://schemas.android.com/apk/distribution" + package="{{androidIdentifier}}.{{componentName}}"> fileSystem, ProcessManager: () => processManager, }); - - testUsingContext('compileSdk 35 and AGP < 8.1', () async { - const String errorExample = r''' -Execution failed for task ':app:bundleReleaseResources'. -> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable - > Android resource linking failed - aapt2 E 08-19 15:06:26 76078 5921862 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. - aapt2 E 08-19 15:06:26 76078 5921862 ApkAssets.cpp:152] Failed to load resources table in APK '/Users/mackall/Library/Android/sdk/platforms/android-35/android.jar'. - error: failed to load include path /Users/mackall/Library/Android/sdk/platforms/android-35/android.jar. - '''; - - await incompatibleCompileSdk35AndAgpVersionHandler.handler( - line: errorExample, - project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), - usesAndroidX: true, - ); - - expect( - testLogger.statusText, - contains( - '\n' - '┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐\n' - '│ [!] Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher. │\n' - '│ Please upgrade to a newer AGP version. The version of AGP that your project uses is likely │\n' - '│ defined in: │\n' - '│ /android/settings.gradle, │\n' - "│ in the 'plugins' closure. │\n" - '│ Alternatively, if your project was created with an older version of the templates, it is likely │\n' - '│ │\n' - '│ in the buildscript.dependencies closure of the top-level build.gradle: │\n' - '│ /android/build.gradle. │\n' - '│ │\n' - '│ Finally, if you have a strong reason to avoid upgrading AGP, you can temporarily lower the │\n' - '│ compileSdk version in the following file: │\n' - '│ /android/app/build.gradle │\n' - '└──────────────────────────────────────────────────────────────────────────────────────────────────┘\n' - '' - ) - ); - }, overrides: { - GradleUtils: () => FakeGradleUtils(), - Platform: () => fakePlatform('android'), - FileSystem: () => fileSystem, - ProcessManager: () => processManager, - }); } bool formatTestErrorMessage(String errorMessage, GradleHandledError error) { diff --git a/packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart b/packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart index 992308d8c0..5a768798ba 100644 --- a/packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart +++ b/packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart @@ -63,14 +63,14 @@ apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gra ); buildGradle.writeAsStringSync(r''' buildscript { - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart b/packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart index c08fc31438..05dfabfc3f 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart @@ -77,9 +77,7 @@ class DeferredComponentModule { apply plugin: "com.android.dynamic-feature" android { - namespace = "com.example.''' + name + r''' -" - compileSdk 35 + compileSdk 34 sourceSets { applicationVariants.all { variant -> @@ -90,7 +88,7 @@ class DeferredComponentModule { defaultConfig { minSdkVersion 21 - targetSdkVersion 35 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -107,7 +105,8 @@ class DeferredComponentModule { writeFile(fileSystem.path.join(dir.path, 'android', name, 'src', 'main', 'AndroidManifest.xml'), ''' + xmlns:dist="http://schemas.android.com/apk/distribution" + package="com.example.$name"> r''' buildscript { - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -175,19 +175,9 @@ class BasicDeferredComponentsConfig extends DeferredComponentsConfig { apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - namespace = "com.example.splitaot" compileSdk flutter.compileSdkVersion ndkVersion flutter.ndkVersion - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } - sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -492,7 +482,8 @@ class BasicDeferredComponentsConfig extends DeferredComponentsConfig { @override String get appManifest => r''' - +