From 5cd440f6ece7ff9fd785c4c89b5b4ba4b93292e3 Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 23:44:26 +0000 Subject: [PATCH] Reverts "Force automatic ndk download when building for Android (#159756)" (#160205) Reverts: flutter/flutter#159756 Initiated by: gmackall Reason for reverting: Made the tree red due to some std out. Original PR Author: gmackall Reviewed By: {reidbaker} This change reverts the following previous change: In preparation for changing engine builds to be unstripped by default https://github.com/flutter/engine/pull/52852, which will allow us to make progress towards resolving https://github.com/flutter/flutter/issues/60240. Tricks AGP in to downloading the NDK when building a flutter app (that uses the FGP, which to my knowledge is all ways of building flutter apk/aab/aar). I want to follow this up by modifying the tool to search for the log line that the NDK is missing (making it throw an error in that case) as a safeguard, because that would be the last line of defense before we accidentally build a bloated app. The safeguard won't work for add to app, from what I understand, because while they use the FGP (so they should be forced to be download the NDK) they don't invoke the flutter tool, and therefore won't invoke the custom error handling of [`gradle_errors.dart`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/gradle_errors.dart) Some details 1. Respects existing values for `externalNativeBuild.cmake.path` for apps that actually use it. 2. Silences some warnings that would otherwise appear for add to app builds or builds that manually invoke gradle: ``` C/C++: CMake Warning (dev) in CMakeLists.txt: C/C++: No project() command is present. The top-level CMakeLists.txt file must C/C++: contain a literal, direct call to the project() command. Add a line of C/C++: code such as C/C++: project(ProjectName) C/C++: near the top of the file, but after cmake_minimum_required(). C/C++: CMake is pretending there is a "project(Project)" command on the first C/C++: line. C/C++: This warning is for project developers. Use -Wno-dev to suppress it. C/C++: CMake Warning: C/C++: Manually-specified variables were not used by the project: C/C++: CMAKE_EXPORT_COMPILE_COMMANDS C/C++: CMAKE_LIBRARY_OUTPUT_DIRECTORY C/C++: CMAKE_RUNTIME_OUTPUT_DIRECTORY ``` 3. Our ci installs the NDK at an abnormal place that AGP can't find without help. I've modified all the `build.gradle`s that we have checked in to point to the pre-installed path. **But some of our tests make a new app from the templates, and those tests will now start downloading the NDK** (as they won't be able to find it at it's current path from templates). We could resolve this by actually fixing https://github.com/flutter/flutter/issues/136666. This would be a very significant lift from what I understand - we rely on this hardcoding in a lot of places in our infra. Fixes https://github.com/flutter/flutter/issues/155576 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md Co-authored-by: auto-submit[bot] --- .ci.yaml | 6 ++-- dev/a11y_assessments/android/app/build.gradle | 10 +----- .../complex_layout/android/app/build.gradle | 9 ----- .../macrobenchmarks/android/app/build.gradle | 9 ----- .../microbenchmarks/android/app/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../test_apps/stocks/android/app/build.gradle | 9 ----- .../tasks/gradle_desugar_classes_test.dart | 2 +- .../android/app/build.gradle | 9 ----- .../android/app/build.gradle | 10 +----- .../android_views/android/app/build.gradle | 9 ----- .../channels/android/app/build.gradle | 10 +----- .../android/app/build.gradle | 9 ----- .../android/component1/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../flavors/android/app/build.gradle | 9 ----- .../flutter_gallery/android/app/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../app/build.gradle | 9 ----- .../android/app/build.gradle | 10 +----- .../non_nullable/android/app/build.gradle | 9 ----- .../android/app/build.gradle | 9 ----- .../SampleApp/build.gradle | 9 ----- .../app/build.gradle | 9 ----- .../app/build.gradle.kts | 9 ----- .../android/app/build.gradle | 9 ----- .../spell_check/android/app/build.gradle | 10 +----- .../ui/android/app/build.gradle | 9 ----- dev/manual_tests/android/app/build.gradle | 9 ----- dev/tracing_tests/android/app/build.gradle | 9 ----- .../flutter_view/android/app/build.gradle | 9 ----- .../hello_world/android/app/build.gradle.kts | 9 ----- examples/image_list/android/app/build.gradle | 9 ----- examples/layers/android/app/build.gradle | 9 ----- .../platform_channel/android/app/build.gradle | 9 ----- .../platform_view/android/app/build.gradle | 9 ----- .../gradle/src/main/groovy/CMakeLists.txt | 3 -- .../gradle/src/main/groovy/flutter.groovy | 33 +------------------ .../example/android/app/build.gradle | 14 +++----- 42 files changed, 14 insertions(+), 382 deletions(-) delete mode 100644 packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt 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