Skip to content

Commit 7730f29

Browse files
Reverts "Update template/test compileSdk, targetSdk, ndk versions (flutter#152487)" (flutter#153793)
Reverts: 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.](flutter@fee34fd) - [Stopped lockfile generation](flutter@82324a2) 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](flutter@6aa187b).
1 parent ef9cd32 commit 7730f29

File tree

51 files changed

+280
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+280
-403
lines changed

dev/benchmarks/microbenchmarks/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

dev/benchmarks/microbenchmarks/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pluginManagement {
2323

2424
plugins {
2525
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26-
id "com.android.application" version "8.1.0" apply false
27-
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
26+
id "com.android.application" version "7.3.0" apply false
27+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
2828
}
2929

3030
include ":app"

dev/benchmarks/multiple_flutters/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
mavenCentral()
1111
}
1212
dependencies {
13-
classpath "com.android.tools.build:gradle:8.1.0"
13+
classpath "com.android.tools.build:gradle:7.3.0"
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515

1616
// Do not place your application dependencies here; they belong

dev/benchmarks/multiple_flutters/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

dev/devicelab/bin/tasks/android_java11_dependency_smoke_tests.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,14 @@ List<VersionTuple> versionTuples = <VersionTuple>[
2525

2626
// This test requires a Java version less than 17 due to the intentionally low
2727
// version of Gradle. We choose 11 because this was the primary version used in
28-
// CI before 17, and hence it is also hosted on CIPD. It also overrides to
29-
// compileSdkVersion 34 because compileSdk 35 requires AGP 8.0+.
28+
// CI before 17, and hence it is also hosted on CIPD.
3029
// https://docs.gradle.org/current/userguide/compatibility.html
3130
Future<void> main() async {
3231
/// The [FileSystem] for the integration test environment.
3332
const LocalFileSystem fileSystem = LocalFileSystem();
3433

35-
final Directory tempDir = fileSystem
36-
.systemTempDirectory
37-
.createTempSync('flutter_android_dependency_version_tests');
34+
final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_android_dependency_version_tests');
3835
await task(() {
39-
return buildFlutterApkWithSpecifiedDependencyVersions(
40-
versionTuples: versionTuples,
41-
compileSdkOverride: '34',
42-
tempDir: tempDir,
43-
localFileSystem: fileSystem
44-
);
36+
return buildFlutterApkWithSpecifiedDependencyVersions(versionTuples: versionTuples, tempDir: tempDir, localFileSystem: fileSystem);
4537
});
4638
}

dev/devicelab/bin/tasks/module_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ class ModuleTest {
449449
Future<void> main() async {
450450
await task(combine(<TaskFunction>[
451451
// ignore: avoid_redundant_argument_values
452-
ModuleTest('module-gradle-7.6', gradleVersion: '8.4').call,
453-
ModuleTest('module-gradle-7.6', gradleVersion: '8.4-rc-3').call,
452+
ModuleTest('module-gradle-7.6', gradleVersion: '7.6.3').call,
453+
ModuleTest('module-gradle-7.6', gradleVersion: '7.6-rc-2').call,
454454
]));
455455
}

dev/devicelab/lib/framework/dependency_smoke_test_task_definition.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-GRADLE_REPLACE
5858
''';
5959

6060
const String gradleReplacementString = 'GRADLE_REPLACE_ME';
61-
const String flutterCompileSdkString = 'flutter.compileSdkVersion';
6261

6362
/// A simple class containing a Kotlin, Gradle, and AGP version.
6463
class VersionTuple {
@@ -88,7 +87,6 @@ class VersionTuple {
8887
/// fails, returns a successful result otherwise. Cleans up in either case.
8988
Future<TaskResult> buildFlutterApkWithSpecifiedDependencyVersions({
9089
required List<VersionTuple> versionTuples,
91-
String? compileSdkOverride,
9290
required Directory tempDir,
9391
required LocalFileSystem localFileSystem,}) async {
9492
for (final VersionTuple versions in versionTuples) {
@@ -107,14 +105,6 @@ Future<TaskResult> buildFlutterApkWithSpecifiedDependencyVersions({
107105

108106
final String appPath = '${innerTempDir.absolute.path}/dependency_checker_app';
109107

110-
if (compileSdkOverride != null) {
111-
final File appGradleBuild = localFileSystem.file(localFileSystem.path.join(
112-
appPath, 'android', 'app', 'build.gradle'));
113-
final String appBuildContent = appGradleBuild.readAsStringSync()
114-
.replaceFirst(flutterCompileSdkString, compileSdkOverride);
115-
appGradleBuild.writeAsStringSync(appBuildContent);
116-
}
117-
118108
// Modify gradle version to passed in version.
119109
final File gradleWrapperProperties = localFileSystem.file(localFileSystem.path.join(
120110
appPath, 'android', 'gradle', 'wrapper', 'gradle-wrapper.properties'));

dev/integration_tests/android_custom_host_app/SampleApp/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
apply plugin: 'com.android.application'
66

77
android {
8-
namespace = "io.flutter.add2app"
98
compileSdk 34
109

1110
compileOptions {

dev/integration_tests/android_custom_host_app/SampleApp/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Use of this source code is governed by a BSD-style license that can be
33
found in the LICENSE file. -->
44

55
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
6-
xmlns:tools="http://schemas.android.com/tools">
6+
xmlns:tools="http://schemas.android.com/tools"
7+
package="io.flutter.add2app">
78

89
<application android:allowBackup="false"
910
tools:ignore="GoogleAppIndexingWarning,MissingApplicationIcon">

dev/integration_tests/android_custom_host_app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
mavenCentral()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.1.0'
11+
classpath 'com.android.tools.build:gradle:7.3.0'
1212
}
1313
}
1414

0 commit comments

Comments
 (0)