import java.io.FileInputStream import java.util.Properties val keystoreProperties = Properties() val keystorePropertiesFile = rootProject.file("key.properties") if (keystorePropertiesFile.exists()) { keystoreProperties.load(FileInputStream(keystorePropertiesFile)) } plugins { id("com.android.application") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } android { namespace = "com.companionglp.glpcompanion" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { // flutter_local_notifications schedules via java.time, which is only // in the platform from API 26; core library desugaring backports it // for minSdk devices (required by the plugin's AAR metadata). isCoreLibraryDesugaringEnabled = true sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { applicationId = "com.companionglp.glpcompanion" // API 26 (Android 8.0) floor required by the `health` plugin (Health // Connect / HealthKit bridge), which declares minSdk 26 in its // manifest; Health Connect itself only ships on Android 8.0+. minSdk = maxOf(flutter.minSdkVersion, 26) targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } signingConfigs { create("release") { if (keystorePropertiesFile.exists()) { keyAlias = keystoreProperties.getProperty("keyAlias") keyPassword = keystoreProperties.getProperty("keyPassword") storeFile = file(keystoreProperties.getProperty("storeFile")) storePassword = keystoreProperties.getProperty("storePassword") } } } buildTypes { getByName("release") { signingConfig = signingConfigs.getByName("release") isMinifyEnabled = true isShrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } } kotlin { compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) } } flutter { source = "../.." } dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") }