diff --git a/.ci.yaml b/.ci.yaml index a5eb7ddba6..57d08af984 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -5503,7 +5503,7 @@ targets: add_recipes_cq: "true" dependencies: >- [ - {"dependency": "android_sdk", "version": "version:35v1"}, + {"dependency": "android_sdk", "version": "version:33v6"}, {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"}, {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}, @@ -5521,7 +5521,7 @@ targets: add_recipes_cq: "true" dependencies: >- [ - {"dependency": "android_sdk", "version": "version:35v1"}, + {"dependency": "android_sdk", "version": "version:33v6"}, {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"}, {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}, @@ -5539,7 +5539,7 @@ targets: add_recipes_cq: "true" dependencies: >- [ - {"dependency": "android_sdk", "version": "version:35v1"}, + {"dependency": "android_sdk", "version": "version:33v6"}, {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"}, {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "goldctl", "version": "git_revision:2387d6fff449587eecbb7e45b2692ca0710b63b9"}, diff --git a/dev/a11y_assessments/android/app/build.gradle b/dev/a11y_assessments/android/app/build.gradle index d040546cc3..c911663423 100644 --- a/dev/a11y_assessments/android/app/build.gradle +++ b/dev/a11y_assessments/android/app/build.gradle @@ -35,15 +35,7 @@ if (keystorePropertiesFile.exists()) { android { namespace "com.example.a11y_assessments" compileSdk flutter.compileSdkVersion - - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } + ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/benchmarks/complex_layout/android/app/build.gradle b/dev/benchmarks/complex_layout/android/app/build.gradle index 8b00ebb415..f86cb35c1d 100644 --- a/dev/benchmarks/complex_layout/android/app/build.gradle +++ b/dev/benchmarks/complex_layout/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "com.yourcompany.complexLayout" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 diff --git a/dev/benchmarks/macrobenchmarks/android/app/build.gradle b/dev/benchmarks/macrobenchmarks/android/app/build.gradle index f358286d00..06acb88de4 100644 --- a/dev/benchmarks/macrobenchmarks/android/app/build.gradle +++ b/dev/benchmarks/macrobenchmarks/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "com.example.macrobenchmarks" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/benchmarks/microbenchmarks/android/app/build.gradle b/dev/benchmarks/microbenchmarks/android/app/build.gradle index e3fc68e472..141ac9622f 100644 --- a/dev/benchmarks/microbenchmarks/android/app/build.gradle +++ b/dev/benchmarks/microbenchmarks/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "com.yourcompany.microbenchmarks" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/benchmarks/multiple_flutters/android/app/build.gradle b/dev/benchmarks/multiple_flutters/android/app/build.gradle index 9cea465111..6a671e475e 100644 --- a/dev/benchmarks/multiple_flutters/android/app/build.gradle +++ b/dev/benchmarks/multiple_flutters/android/app/build.gradle @@ -16,15 +16,6 @@ android { namespace "dev.flutter.multipleflutters" compileSdk 34 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = "26.3.11579264" // This version must exactly match the version of the NDK that the recipe pulls from CIPD. - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/benchmarks/platform_views_layout/android/app/build.gradle b/dev/benchmarks/platform_views_layout/android/app/build.gradle index 9504f0ae17..63c7e0bee4 100644 --- a/dev/benchmarks/platform_views_layout/android/app/build.gradle +++ b/dev/benchmarks/platform_views_layout/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "dev.benchmarks.platform_views_layout" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/benchmarks/platform_views_layout_hybrid_composition/android/app/build.gradle b/dev/benchmarks/platform_views_layout_hybrid_composition/android/app/build.gradle index ee181f49dc..2beb7dc539 100644 --- a/dev/benchmarks/platform_views_layout_hybrid_composition/android/app/build.gradle +++ b/dev/benchmarks/platform_views_layout_hybrid_composition/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "dev.benchmarks.platform_views_layout_hybrid_composition" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/benchmarks/test_apps/stocks/android/app/build.gradle b/dev/benchmarks/test_apps/stocks/android/app/build.gradle index 6dbd28b9da..5e7907e25e 100644 --- a/dev/benchmarks/test_apps/stocks/android/app/build.gradle +++ b/dev/benchmarks/test_apps/stocks/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "io.flutter.examples.stocks" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart b/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart index 5427ab8bd4..2d6062ed35 100644 --- a/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart +++ b/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart @@ -15,7 +15,7 @@ Future main() async { try { await runProjectTest((FlutterProject flutterProject) async { section('APK contains plugin classes'); - await flutterProject.setMinSdkVersion(21); + await flutterProject.setMinSdkVersion(20); await flutterProject.addPlugin('google_maps_flutter:^2.2.1'); await inDirectory(flutterProject.rootPath, () async { diff --git a/dev/integration_tests/android_semantics_testing/android/app/build.gradle b/dev/integration_tests/android_semantics_testing/android/app/build.gradle index 1bcd40e4a3..25afe619de 100644 --- a/dev/integration_tests/android_semantics_testing/android/app/build.gradle +++ b/dev/integration_tests/android_semantics_testing/android/app/build.gradle @@ -20,15 +20,6 @@ android { namespace = "com.yourcompany.platforminteraction" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/android_verified_input/android/app/build.gradle b/dev/integration_tests/android_verified_input/android/app/build.gradle index e6f0187e1e..995fb86b32 100644 --- a/dev/integration_tests/android_verified_input/android/app/build.gradle +++ b/dev/integration_tests/android_verified_input/android/app/build.gradle @@ -29,15 +29,7 @@ if (flutterVersionName == null) { android { namespace "io.flutter.integration.android_verified_input" compileSdk flutter.compileSdkVersion - - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } + ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/android_views/android/app/build.gradle b/dev/integration_tests/android_views/android/app/build.gradle index a376d48367..8596326f55 100644 --- a/dev/integration_tests/android_views/android/app/build.gradle +++ b/dev/integration_tests/android_views/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace = 'io.flutter.integration.platformviews' compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/channels/android/app/build.gradle b/dev/integration_tests/channels/android/app/build.gradle index 29638d599d..17f8f1332c 100644 --- a/dev/integration_tests/channels/android/app/build.gradle +++ b/dev/integration_tests/channels/android/app/build.gradle @@ -29,15 +29,7 @@ if (flutterVersionName == null) { android { namespace "com.example.channels" compileSdk flutter.compileSdkVersion - - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } + ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/deferred_components_test/android/app/build.gradle b/dev/integration_tests/deferred_components_test/android/app/build.gradle index f17f930b4b..69750fb03d 100644 --- a/dev/integration_tests/deferred_components_test/android/app/build.gradle +++ b/dev/integration_tests/deferred_components_test/android/app/build.gradle @@ -36,15 +36,6 @@ android { namespace "io.flutter.integration.deferred_components_test" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - sourceSets { main.java.srcDirs += 'src/main/kotlin' } 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 5354de1031..9daab6d9c9 100644 --- a/dev/integration_tests/deferred_components_test/android/component1/build.gradle +++ b/dev/integration_tests/deferred_components_test/android/component1/build.gradle @@ -26,15 +26,6 @@ android { namespace "io.flutter.integration.deferred_components_test.component1" compileSdk 35 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = "26.3.11579264" // This version must exactly match the version of the NDK that the recipe pulls from CIPD. - ndkPath = systemNdkPath - } - sourceSets { applicationVariants.all { variant -> main.assets.srcDirs += "${project.layout.buildDirectory.get()}/intermediates/flutter/${variant.name}/deferred_assets" diff --git a/dev/integration_tests/external_textures/android/app/build.gradle b/dev/integration_tests/external_textures/android/app/build.gradle index c6adeef108..7e1c89b3a5 100644 --- a/dev/integration_tests/external_textures/android/app/build.gradle +++ b/dev/integration_tests/external_textures/android/app/build.gradle @@ -19,15 +19,6 @@ android { namespace = "io.flutter.externalui" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/flavors/android/app/build.gradle b/dev/integration_tests/flavors/android/app/build.gradle index 9044bc258a..5b091f702a 100644 --- a/dev/integration_tests/flavors/android/app/build.gradle +++ b/dev/integration_tests/flavors/android/app/build.gradle @@ -19,15 +19,6 @@ android { namespace "com.yourcompany.flavors" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/flutter_gallery/android/app/build.gradle b/dev/integration_tests/flutter_gallery/android/app/build.gradle index df976a59cd..5c5fa7d61c 100644 --- a/dev/integration_tests/flutter_gallery/android/app/build.gradle +++ b/dev/integration_tests/flutter_gallery/android/app/build.gradle @@ -45,15 +45,6 @@ android { namespace "io.flutter.demo.gallery" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/gradle_deprecated_settings/android/app/build.gradle b/dev/integration_tests/gradle_deprecated_settings/android/app/build.gradle index 64c3432e3b..ecb2deeb6d 100644 --- a/dev/integration_tests/gradle_deprecated_settings/android/app/build.gradle +++ b/dev/integration_tests/gradle_deprecated_settings/android/app/build.gradle @@ -22,15 +22,6 @@ android { namespace = "com.yourcompany.flavors" compileSdk 34 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/hybrid_android_views/android/app/build.gradle b/dev/integration_tests/hybrid_android_views/android/app/build.gradle index b595440083..5fb0d47446 100644 --- a/dev/integration_tests/hybrid_android_views/android/app/build.gradle +++ b/dev/integration_tests/hybrid_android_views/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace = "io.flutter.integration.platformviews" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 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 75f07cb601..1e69c1f986 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 @@ -8,15 +8,6 @@ android { namespace = "io.flutter.addtoapp" compileSdk 34 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = "26.3.11579264" // This version must exactly match the version of the NDK that the recipe pulls from CIPD. - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/native_driver_test/android/app/build.gradle b/dev/integration_tests/native_driver_test/android/app/build.gradle index 4734c2bdd7..c5b106e0c9 100644 --- a/dev/integration_tests/native_driver_test/android/app/build.gradle +++ b/dev/integration_tests/native_driver_test/android/app/build.gradle @@ -12,15 +12,7 @@ plugins { android { namespace = "com.example.native_driver_test" compileSdk = flutter.compileSdkVersion - - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } + ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/non_nullable/android/app/build.gradle b/dev/integration_tests/non_nullable/android/app/build.gradle index 3b305e5ad8..9822c24687 100644 --- a/dev/integration_tests/non_nullable/android/app/build.gradle +++ b/dev/integration_tests/non_nullable/android/app/build.gradle @@ -30,15 +30,6 @@ android { namespace = "com.example.non_nullable" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/platform_interaction/android/app/build.gradle b/dev/integration_tests/platform_interaction/android/app/build.gradle index 5dfccb53e2..7f8fea246c 100644 --- a/dev/integration_tests/platform_interaction/android/app/build.gradle +++ b/dev/integration_tests/platform_interaction/android/app/build.gradle @@ -19,15 +19,6 @@ android { namespace = "com.yourcompany.platforminteraction" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/pure_android_host_apps/android_custom_host_app/SampleApp/build.gradle b/dev/integration_tests/pure_android_host_apps/android_custom_host_app/SampleApp/build.gradle index 0227cf37b2..1ec1e7bc65 100644 --- a/dev/integration_tests/pure_android_host_apps/android_custom_host_app/SampleApp/build.gradle +++ b/dev/integration_tests/pure_android_host_apps/android_custom_host_app/SampleApp/build.gradle @@ -8,15 +8,6 @@ android { namespace = "io.flutter.add2app" compileSdk 34 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = "26.3.11579264" // This version must exactly match the version of the NDK that the recipe pulls from CIPD. - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle b/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle index fee774a0c7..71abced98b 100644 --- a/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle +++ b/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle @@ -8,15 +8,6 @@ android { namespace = "io.flutter.add2app" compileSdk 34 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = "26.3.11579264" // This version must exactly match the version of the NDK that the recipe pulls from CIPD. - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/pure_android_host_apps/host_app_kotlin_gradle_dsl/app/build.gradle.kts b/dev/integration_tests/pure_android_host_apps/host_app_kotlin_gradle_dsl/app/build.gradle.kts index d7189b8355..80fc8488e9 100644 --- a/dev/integration_tests/pure_android_host_apps/host_app_kotlin_gradle_dsl/app/build.gradle.kts +++ b/dev/integration_tests/pure_android_host_apps/host_app_kotlin_gradle_dsl/app/build.gradle.kts @@ -7,15 +7,6 @@ android { namespace = "com.example.myapplication" compileSdk = 34 - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - val systemNdkPath: String? = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = "26.3.11579264" // This version must exactly match the version of the NDK that the recipe pulls from CIPD. - ndkPath = systemNdkPath - } - defaultConfig { applicationId = "com.example.myapplication" minSdk = 24 diff --git a/dev/integration_tests/release_smoke_test/android/app/build.gradle b/dev/integration_tests/release_smoke_test/android/app/build.gradle index 526a60cf47..357e24908a 100644 --- a/dev/integration_tests/release_smoke_test/android/app/build.gradle +++ b/dev/integration_tests/release_smoke_test/android/app/build.gradle @@ -30,15 +30,6 @@ android { namespace = "com.example.release_smoke_test" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/spell_check/android/app/build.gradle b/dev/integration_tests/spell_check/android/app/build.gradle index 242e3d7360..40d896e873 100644 --- a/dev/integration_tests/spell_check/android/app/build.gradle +++ b/dev/integration_tests/spell_check/android/app/build.gradle @@ -29,15 +29,7 @@ if (flutterVersionName == null) { android { namespace "com.example.spell_check" compileSdk flutter.compileSdkVersion - - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } + ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/integration_tests/ui/android/app/build.gradle b/dev/integration_tests/ui/android/app/build.gradle index b661791560..0b7c795741 100644 --- a/dev/integration_tests/ui/android/app/build.gradle +++ b/dev/integration_tests/ui/android/app/build.gradle @@ -12,15 +12,6 @@ android { namespace "com.yourcompany.integration_ui" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/manual_tests/android/app/build.gradle b/dev/manual_tests/android/app/build.gradle index 7ae76f585d..8321f807a8 100644 --- a/dev/manual_tests/android/app/build.gradle +++ b/dev/manual_tests/android/app/build.gradle @@ -30,15 +30,6 @@ android { namespace = "dev.flutter.manual_tests" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/dev/tracing_tests/android/app/build.gradle b/dev/tracing_tests/android/app/build.gradle index 438f04ee24..a3bd4a16a4 100644 --- a/dev/tracing_tests/android/app/build.gradle +++ b/dev/tracing_tests/android/app/build.gradle @@ -30,15 +30,6 @@ android { namespace = "com.example.tracing_tests" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/examples/flutter_view/android/app/build.gradle b/examples/flutter_view/android/app/build.gradle index 1feb5a505b..7c18e6456f 100644 --- a/examples/flutter_view/android/app/build.gradle +++ b/examples/flutter_view/android/app/build.gradle @@ -11,15 +11,6 @@ android { namespace "com.example.view" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/examples/hello_world/android/app/build.gradle.kts b/examples/hello_world/android/app/build.gradle.kts index d0e5ec689c..175e23095a 100644 --- a/examples/hello_world/android/app/build.gradle.kts +++ b/examples/hello_world/android/app/build.gradle.kts @@ -11,15 +11,6 @@ android { namespace = "io.flutter.examples.hello_world" compileSdk = flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - val systemNdkPath: String? = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/examples/image_list/android/app/build.gradle b/examples/image_list/android/app/build.gradle index 1adead8eb0..e4b8b76b39 100644 --- a/examples/image_list/android/app/build.gradle +++ b/examples/image_list/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "com.example.image_list" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/examples/layers/android/app/build.gradle b/examples/layers/android/app/build.gradle index 3cb9dd323c..87d5fd2ee6 100644 --- a/examples/layers/android/app/build.gradle +++ b/examples/layers/android/app/build.gradle @@ -11,15 +11,6 @@ android { namespace "io.flutter.examples.Layers" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/examples/platform_channel/android/app/build.gradle b/examples/platform_channel/android/app/build.gradle index 762775b520..6da008a41b 100644 --- a/examples/platform_channel/android/app/build.gradle +++ b/examples/platform_channel/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "com.example.platformchannel" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/examples/platform_view/android/app/build.gradle b/examples/platform_view/android/app/build.gradle index b66e071395..2fda0ca212 100644 --- a/examples/platform_view/android/app/build.gradle +++ b/examples/platform_view/android/app/build.gradle @@ -29,15 +29,6 @@ android { namespace "io.flutter.examples.platform_view" compileSdk flutter.compileSdkVersion - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt b/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt deleted file mode 100644 index ae7354f572..0000000000 --- a/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Empty file to trick the Android Gradle Plugin to download the NDK. This is because AGP requires -# the NDK in order to strip debug symbols from native libraries, does not download it in that case -# (instead, AGP only downloads it when AGP thinks it needs the NDK to build a native library). diff --git a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy index e9ef058072..dfec35b704 100644 --- a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy +++ b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy @@ -62,7 +62,7 @@ class FlutterExtension { * Chosen as default version of the AGP version below as found in * https://developer.android.com/studio/projects/install-ndk#default-ndk-per-agp. */ - public final String ndkVersion = "26.3.11579264" + public final String ndkVersion = "26.1.10909125" /** * Specifies the relative directory to the Flutter project directory. @@ -279,7 +279,6 @@ class FlutterPlugin implements Plugin { extension.flutterVersionName = flutterVersionName ?: "1.0" this.addFlutterTasks(project) - forceNdkDownload(project, flutterRootPath) // By default, assembling APKs generates fat APKs if multiple platforms are passed. // Configuring split per ABI allows to generate separate APKs for each abi. @@ -860,36 +859,6 @@ class FlutterPlugin implements Plugin { return version2 } - private void forceNdkDownload(Project gradleProject, String flutterSdkRootPath) { - // If the project is already configuring a native build, we don't need to do anything. - Boolean forcingNotRequired = gradleProject.android.externalNativeBuild.cmake.path != null - if (forcingNotRequired) { - return - } - - // Otherwise, point to an empty CMakeLists.txt, and ignore associated warnings. - gradleProject.android { - externalNativeBuild { - cmake { - // Respect the existing configuration if it exists - the NDK will already be - // downloaded in this case. - path = flutterSdkRootPath + "/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt" - } - } - - defaultConfig { - externalNativeBuild { - cmake { - // CMake will print warnings when you try to build an empty project. - // These arguments silence the warnings - our project is intentionally - // empty. - arguments("-Wno-dev", "--no-warn-unused-cli") - } - } - } - } - } - /** Prints error message and fix for any plugin compileSdkVersion or ndkVersion that are higher than the project. */ private void detectLowCompileSdkVersionOrNdkVersion() { project.afterEvaluate { diff --git a/packages/integration_test/example/android/app/build.gradle b/packages/integration_test/example/android/app/build.gradle index 62d30ab06b..782992d712 100644 --- a/packages/integration_test/example/android/app/build.gradle +++ b/packages/integration_test/example/android/app/build.gradle @@ -26,17 +26,11 @@ if (flutterVersionName == null) { } android { - namespace 'com.example.integration_test_example' - compileSdk flutter.compileSdkVersion - - // Flutter's CI installs the NDK at a non-standard path. - // This non-standard structure is initially created by - // https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh. - String systemNdkPath = System.getenv("ANDROID_NDK_PATH") - if (systemNdkPath != null) { - ndkVersion = flutter.ndkVersion - ndkPath = systemNdkPath + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'com.example.integration_test_example' } + compileSdk flutter.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8