import java.util.Properties import java.io.FileInputStream plugins { id("com.android.application") id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } // conditionally apply google-services (keeps your original intent) if (file("google-services.json").exists()) { apply(plugin = "com.google.gms.google-services") } dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") // For flutter_local_notifications // Workaround for: https://github.com/MaikuB/flutter_local_notifications/issues/2286 implementation(platform("com.google.firebase:firebase-bom:32.8.0")) implementation("com.google.firebase:firebase-analytics") implementation("com.google.firebase:firebase-database") implementation("androidx.multidex:multidex:2.0.1") } // Workaround for https://pub.dev/packages/unifiedpush#the-build-fails-because-of-duplicate-classes configurations.all { // Use the latest version published: https://central.sonatype.com/artifact/com.google.crypto.tink/tink-android val tink = "com.google.crypto.tink:tink-android:1.17.0" // You can also use the library declaration catalog // val tink = libs.google.tink resolutionStrategy { force(tink) dependencySubstitution { substitute(module("com.google.crypto.tink:tink")).using(module(tink)) } } } android { namespace = "com.talktolearn.chat" compileSdk = 35 // compileSdk = flutter.compileSdkVersion // ndkVersion = "27.0.12077973" compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 isCoreLibraryDesugaringEnabled = true } kotlinOptions { jvmTarget = JavaVersion.VERSION_17.toString() } signingConfigs { create("release") { keyAlias = "dummyAlias" keyPassword = "dummyPassword" storeFile = file("dummy.keystore") storePassword = "dummyStorePassword" } } val keystoreProperties = Properties() val keystorePropertiesFile = rootProject.file("key.properties") if (keystorePropertiesFile.exists()) { keystoreProperties.load(FileInputStream(keystorePropertiesFile)) signingConfigs.getByName("release").apply { keyAlias = keystoreProperties["keyAlias"] as String keyPassword = keystoreProperties["keyPassword"] as String storeFile = keystoreProperties["storeFile"]?.let { file(it) } storePassword = keystoreProperties["storePassword"] as String } } defaultConfig { applicationId = "com.talktolearn.chat" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } buildTypes { debug { signingConfig = signingConfigs.getByName("debug") versionNameSuffix = "-debug" isMinifyEnabled = false isShrinkResources = false } release { isMinifyEnabled = false isShrinkResources = false // use the release signing config we created above (will be used only if key properties exist) signingConfig = signingConfigs.getByName("release") proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") } } } flutter { source = "../.." }