import java.io.FileInputStream import java.util.Properties plugins { id("com.android.application") // START: FlutterFire Configuration id("com.google.gms.google-services") // END: FlutterFire Configuration id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } // Release-Signing: Werte kommen aus android/key.properties (nicht im Repo, // siehe key.properties.example). Ohne die Datei wird weiterhin mit dem // Debug-Key signiert, damit lokale Debug-Builds unverändert funktionieren. val keystorePropertiesFile = rootProject.file("key.properties") val keystoreProperties = Properties() val hasReleaseSigning = keystorePropertiesFile.exists() if (hasReleaseSigning) { keystoreProperties.load(FileInputStream(keystorePropertiesFile)) } android { namespace = "dev.leafittome.app" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = JavaVersion.VERSION_17.toString() } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "dev.leafittome.app" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } signingConfigs { if (hasReleaseSigning) { create("release") { keyAlias = keystoreProperties["keyAlias"] as String keyPassword = keystoreProperties["keyPassword"] as String storeFile = file(keystoreProperties["storeFile"] as String) storePassword = keystoreProperties["storePassword"] as String } } } buildTypes { release { // Nutzt den echten Upload-Key, sobald key.properties existiert; // bis dahin Fallback auf den Debug-Key (siehe oben). signingConfig = if (hasReleaseSigning) { signingConfigs.getByName("release") } else { signingConfigs.getByName("debug") } } } } flutter { source = "../.." }