From e82ef6a0064554bb9aa656ad004ba3c3aac670d6 Mon Sep 17 00:00:00 2001 From: Gregory Conrad Date: Sat, 14 Dec 2024 20:07:06 -0500 Subject: [PATCH] fix: update to android gradle v8 (#369) --- packages/flutter_mimir/android/build.gradle | 33 +++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/packages/flutter_mimir/android/build.gradle b/packages/flutter_mimir/android/build.gradle index b818141f..7253571c 100644 --- a/packages/flutter_mimir/android/build.gradle +++ b/packages/flutter_mimir/android/build.gradle @@ -1,5 +1,5 @@ -group 'com.gsconrad.flutter_mimir' -version '0.0.1' +group = "com.gsconrad.flutter_mimir" +version = "0.0.1" buildscript { repositories { @@ -9,7 +9,7 @@ buildscript { dependencies { // The Android Gradle Plugin knows how to build native code with the NDK. - classpath 'com.android.tools.build:gradle:7.1.2' + classpath("com.android.tools.build:gradle:8.1.0") } } @@ -20,19 +20,34 @@ rootProject.allprojects { } } -apply plugin: 'com.android.library' +apply plugin: "com.android.library" android { - compileSdkVersion 31 + namespace = "com.gsconrad.flutter_mimir" - defaultConfig { - minSdkVersion 16 - } + // Bumping the plugin compileSdk version requires all clients of this plugin + // to bump the version in their app. + compileSdk = 35 + + // Use the NDK version + // declared in /android/app/build.gradle file of the Flutter project. + // Replace it with a version number if this plugin requires a specific NDK version. + // (e.g. ndkVersion "23.1.7779620") + ndkVersion = android.ndkVersion // Trigger the binary download/update over in CMakeLists.txt externalNativeBuild { cmake { - path "CMakeLists.txt" + path = "CMakeLists.txt" } } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + defaultConfig { + minSdk = 21 + } }