Reverts "[Android] Support Android 34" (#137865)

Reverts flutter/flutter#137191
Initiated by: camsim99
This change reverts the following previous change:
Original Description:
Adds support for Android 34 in the following ways:

- Bumps integration tests compile SDK versions 33 --> 34
- Bumps template compile SDK version 33 --> 34
- Also changes deprecated `compileSdkVersion` to `compileSdk`

Part of https://github.com/flutter/flutter/issues/134220
This commit is contained in:
auto-submit[bot] 2023-11-03 20:14:19 +00:00 committed by GitHub
parent a52f030cda
commit c4ce9479bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 78 additions and 78 deletions

View File

@ -28,7 +28,7 @@ if (flutterVersionName == null) {
android {
namespace "com.example.a11y_assessments"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -20,7 +20,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.yourcompany.complexLayout"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_11

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.macrobenchmarks"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -20,7 +20,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.yourcompany.microbenchmarks"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -14,7 +14,7 @@ android {
}
namespace "dev.flutter.multipleflutters"
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -20,7 +20,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "dev.benchmarks.platform_views_layout"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -20,7 +20,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "dev.benchmarks.platform_views_layout_hybrid_composition"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "io.flutter.examples.stocks"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -5,7 +5,7 @@
apply plugin: 'com.android.application'
android {
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -5,7 +5,7 @@
apply plugin: 'com.android.application'
android {
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -19,7 +19,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -29,7 +29,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -31,7 +31,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.channels"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -37,7 +37,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "io.flutter.integration.deferred_components_test"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
sourceSets {
main.java.srcDirs += 'src/main/kotlin'

View File

@ -24,7 +24,7 @@ apply plugin: "com.android.dynamic-feature"
android {
namespace "io.flutter.integration.deferred_components_test.component1"
compileSdk 34
compileSdkVersion 33
sourceSets {
applicationVariants.all { variant ->

View File

@ -19,7 +19,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -20,7 +20,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.yourcompany.flavors"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -41,7 +41,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "io.flutter.demo.gallery"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -19,7 +19,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -29,7 +29,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -5,7 +5,7 @@
apply plugin: 'com.android.application'
android {
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -19,7 +19,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -29,7 +29,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -31,7 +31,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.spell_check"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -20,7 +20,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.yourcompany.integration_ui"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -31,7 +31,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "dev.flutter.flutter_api_samples"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.view"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -27,7 +27,7 @@ if (flutterVersionName == null) {
android {
namespace "io.flutter.examples.hello_world"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.image_list"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "io.flutter.examples.Layers"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.platformchannel"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -30,7 +30,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "io.flutter.examples.platform_view"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -41,7 +41,7 @@ import org.gradle.internal.os.OperatingSystem
*/
class FlutterExtension {
/** Sets the compileSdkVersion used by default in Flutter app projects. */
static int compileSdkVersion = 34
static int compileSdkVersion = 33
/** Sets the minSdkVersion used by default in Flutter app projects. */
static int minSdkVersion = 19

View File

@ -613,10 +613,10 @@ final GradleHandledError minCompileSdkVersionHandler = GradleHandledError(
.childDirectory('app')
.childFile('build.gradle');
globals.printBox(
'${globals.logger.terminal.warningMark} Your project requires a higher compileSdk version.\n'
'Fix this issue by bumping the compileSdk version in ${gradleFile.path}:\n'
'${globals.logger.terminal.warningMark} Your project requires a higher compileSdkVersion.\n'
'Fix this issue by bumping the compileSdkVersion in ${gradleFile.path}:\n'
'android {\n'
' compileSdk ${minCompileSdkVersionMatch?.group(1)}\n'
' compileSdkVersion ${minCompileSdkVersionMatch?.group(1)}\n'
'}',
title: _boxTitle,
);

View File

@ -39,7 +39,7 @@ const String templateKotlinGradlePluginVersion = '1.7.10';
// so new versions are picked up after a Flutter upgrade.
//
// Please see the README before changing any of these values.
const String compileSdkVersion = '34';
const String compileSdkVersion = '33';
const String minSdkVersion = '19';
const String targetSdkVersion = '33';
const String ndkVersion = '23.1.7779620';

View File

@ -24,7 +24,7 @@ if (flutterVersionName == null) {
android {
namespace "{{androidIdentifier}}"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -24,7 +24,7 @@ if (flutterVersionName == null) {
android {
namespace "{{androidIdentifier}}"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -19,7 +19,7 @@ if (flutterVersionName == null) {
apply plugin: "com.android.dynamic-feature"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -29,7 +29,7 @@ android {
namespace '{{androidIdentifier}}'
}
compileSdk {{compileSdkVersion}}
compileSdkVersion {{compileSdkVersion}}
defaultConfig {
minSdkVersion {{minSdkVersion}}
}

View File

@ -8,7 +8,7 @@ android {
namespace "{{androidIdentifier}}.host"
}
compileSdk {{compileSdkVersion}}
compileSdkVersion {{compileSdkVersion}}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -35,7 +35,7 @@ android {
namespace '{{androidIdentifier}}'
}
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -26,7 +26,7 @@ android {
namespace '{{androidIdentifier}}'
}
compileSdk {{compileSdkVersion}}
compileSdkVersion {{compileSdkVersion}}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -29,7 +29,7 @@ android {
namespace '{{androidIdentifier}}'
}
compileSdk {{compileSdkVersion}}
compileSdkVersion {{compileSdkVersion}}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -29,9 +29,9 @@ android {
namespace '{{androidIdentifier}}'
}
// Bumping the plugin compileSdk version requires all clients of this plugin
// Bumping the plugin compileSdkVersion requires all clients of this plugin
// to bump the version in their app.
compileSdk {{compileSdkVersion}}
compileSdkVersion {{compileSdkVersion}}
// Use the NDK version
// declared in /android/app/build.gradle file of the Flutter project.

View File

@ -2865,7 +2865,7 @@ void main() {
final String buildContent = await globals.fs.file('${projectDir.path}/android/app/build.gradle').readAsString();
expect(buildContent.contains('compileSdk flutter.compileSdkVersion'), true);
expect(buildContent.contains('compileSdkVersion flutter.compileSdkVersion'), true);
expect(buildContent.contains('ndkVersion flutter.ndkVersion'), true);
expect(buildContent.contains('targetSdkVersion flutter.targetSdkVersion'), true);
});

View File

@ -70,7 +70,7 @@ if (flutterVersionName == null) {
android {
namespace "com.example.asset_sample"
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {

View File

@ -1081,13 +1081,13 @@ Execution failed for task ':app:checkDebugAarMetadata'.
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────\n'
'│ [!] Your project requires a higher compileSdk version. │\n'
'│ Fix this issue by bumping the compileSdk version in /android/app/build.gradle: │\n'
'│ android { \n'
'│ compileSdk 31 \n'
'│ } \n'
'└───────────────────────────────────────────────────────────────────────────────\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────\n'
'│ [!] Your project requires a higher compileSdkVersion. │\n'
'│ Fix this issue by bumping the compileSdkVersion in /android/app/build.gradle: │\n'
'│ android { \n'
'│ compileSdkVersion 31 │\n'
'│ } \n'
'└───────────────────────────────────────────────────────────────────────────────\n'
)
);
}, overrides: <Type, Generator>{

View File

@ -1662,7 +1662,7 @@ String gradleFileWithApplicationId(String id) {
return '''
apply plugin: 'com.android.application'
android {
compileSdk 34
compileSdkVersion 33
defaultConfig {
applicationId '$id'
@ -1679,7 +1679,7 @@ version '1.0-SNAPSHOT'
apply plugin: 'com.android.library'
android {
compileSdk 34
compileSdkVersion 33
}
''';
}

View File

@ -23,7 +23,7 @@ void main() {
tryToDelete(tempDir);
});
test('error logged when plugin Android compileSdk version higher than project', () async {
test('error logged when plugin Android compileSdkVersion higher than project', () async {
final String flutterBin = fileSystem.path.join(
getFlutterRoot(),
'bin',
@ -46,10 +46,10 @@ void main() {
final String pluginBuildGradle = pluginGradleFile.readAsStringSync();
// Bump up plugin compileSdk version to 31
final RegExp androidCompileSdkVersionRegExp = RegExp(r'compileSdk ([0-9]+|flutter.compileSdkVersion)');
// Bump up plugin compileSdkVersion to 31
final RegExp androidCompileSdkVersionRegExp = RegExp(r'compileSdkVersion ([0-9]+|flutter.compileSdkVersion)');
final String newPluginGradleFile = pluginBuildGradle.replaceAll(
androidCompileSdkVersionRegExp, 'compileSdk 31');
androidCompileSdkVersionRegExp, 'compileSdkVersion 31');
pluginGradleFile.writeAsStringSync(newPluginGradleFile);
final Directory pluginExampleAppDir = pluginAppDir.childDirectory('example');
@ -59,9 +59,9 @@ void main() {
final String projectBuildGradle = projectGradleFile.readAsStringSync();
// Bump down plugin example app compileSdk version to 30
// Bump down plugin example app compileSdkVersion to 30
final String newProjectGradleFile = projectBuildGradle.replaceAll(
androidCompileSdkVersionRegExp, 'compileSdk 30');
androidCompileSdkVersionRegExp, 'compileSdkVersion 30');
projectGradleFile.writeAsStringSync(newProjectGradleFile);
// Run flutter build apk to build plugin example project

View File

@ -40,12 +40,12 @@ void main() {
'build succeeds targeting string compileSdkVersion',
() async {
final File buildGradleFile = exampleAppDir.childDirectory('android').childDirectory('app').childFile('build.gradle');
// write a build.gradle with compileSdk version as `android-Tiramisu` which is a string preview version
// write a build.gradle with compileSdkVersion as `android-Tiramisu` which is a string preview version
buildGradleFile.writeAsStringSync(
buildGradleFile.readAsStringSync().replaceFirst('compileSdk flutter.compileSdkVersion', 'compileSdk "android-Tiramisu"'),
buildGradleFile.readAsStringSync().replaceFirst('compileSdkVersion flutter.compileSdkVersion', 'compileSdkVersion "android-Tiramisu"'),
flush: true
);
expect(buildGradleFile.readAsStringSync(), contains('compileSdk "android-Tiramisu"'));
expect(buildGradleFile.readAsStringSync(), contains('compileSdkVersion "android-Tiramisu"'));
final ProcessResult result = await processManager.run(<String>[
flutterBin,
@ -70,7 +70,7 @@ void main() {
final File buildGradleFile = exampleAppDir.childDirectory('android').childDirectory('app').childFile('build.gradle');
// write a build.gradle with compileSdkPreview as `Tiramisu` which is a string preview version
buildGradleFile.writeAsStringSync(
buildGradleFile.readAsStringSync().replaceFirst('compileSdk flutter.compileSdkVersion', 'compileSdkPreview "Tiramisu"'),
buildGradleFile.readAsStringSync().replaceFirst('compileSdkVersion flutter.compileSdkVersion', 'compileSdkPreview "Tiramisu"'),
flush: true
);
expect(buildGradleFile.readAsStringSync(), contains('compileSdkPreview "Tiramisu"'));

View File

@ -77,7 +77,7 @@ class DeferredComponentModule {
apply plugin: "com.android.dynamic-feature"
android {
compileSdk 34
compileSdkVersion 33
sourceSets {
applicationVariants.all { variant ->

View File

@ -175,7 +175,7 @@ class BasicDeferredComponentsConfig extends DeferredComponentsConfig {
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
sourceSets {

View File

@ -144,7 +144,7 @@ class MultidexProject extends Project {
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -31,7 +31,7 @@ android {
namespace 'dev.flutter.integration_test'
}
compileSdk 34
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View File

@ -33,7 +33,7 @@ android {
if (project.android.hasProperty("namespace")) {
namespace 'com.example.integration_test_example'
}
compileSdk flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8