plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" id "com.google.gms.google-services" } def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } if (project.hasProperty('google-services.json')) { apply plugin: 'com.google.gms.google-services' } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '71' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '2.0.32' } def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file("key.properties") if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } android { namespace "nh.ind.nhance.benefits" // Google Play requires target API 36 (Android 16) as of Aug 31, 2026 compileSdk 36 ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_21 targetCompatibility JavaVersion.VERSION_21 coreLibraryDesugaringEnabled true } kotlinOptions { jvmTarget = '21' } // // In android/app/build.gradle or android/build.gradle: // configurations.all { // resolutionStrategy { // force 'org.bouncycastle:bcprov-jdk18on:1.76' // } // } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "nh.ind.nhance.benefits" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion 36 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. // signingConfig signingConfigs.debug signingConfig signingConfigs.release minifyEnabled true // Enable code shrinking for smaller APKs proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } // ✅ Add this block (required for 16KB support) packagingOptions { jniLibs { useLegacyPackaging = true } } // OR sometimes necessary in newer AGP versions: // This is often the default, but explicitly setting it can help. bundle { abi { enableSplit = true // Ensures a proper split per architecture } } flavorDimensions "app" productFlavors { dev { dimension "app" // no suffix } uat { dimension "app" // no suffix } prod { dimension "app" // no suffix } } } flutter { source '../..' } dependencies { implementation platform("com.google.firebase:firebase-bom:33.12.0") // Latest BOM version implementation "com.google.firebase:firebase-auth:23.2.0" implementation "com.google.firebase:firebase-messaging:24.1.1" implementation("com.google.firebase:firebase-appcheck-playintegrity") implementation 'androidx.browser:browser:1.3.0' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' }