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" } def localProperties = new Properties() def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { localPropertiesFile.withReader("UTF-8") { reader -> localProperties.load(reader) } } def flutterVersionCode = localProperties.getProperty("flutter.versionCode") if (flutterVersionCode == null) { flutterVersionCode = "1" } def flutterVersionName = localProperties.getProperty("flutter.versionName") if (flutterVersionName == null) { flutterVersionName = "1.0" } android { namespace = "me.movenext.bang_navigator" compileSdk = 35 //Temporary fix ndkVersion = "27.0.12077973" //flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '17' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "me.movenext.bang_navigator" // https://api.flutter.dev/flutter/widgets/AndroidView-class.html //https://inappwebview.dev/docs/intro/#setup-android minSdk = 23 targetSdk = 35 versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName } dependencies { // implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // implementation 'androidx.glance:glance-appwidget:1.0.0' implementation 'com.google.android.material:material:1.12.0' } signingConfigs { release { keyAlias System.getenv("KEY_ALIAS") keyPassword System.getenv("KEY_PASSWORD") storeFile System.getenv("KEY_PATH") ? file(System.getenv("KEY_PATH")) : null storePassword System.getenv("KEY_PASSWORD") } } buildTypes { debug { splits { abi { enable true reset() include 'arm64-v8a' //for now build only one target universalApk false } } applicationVariants.all { variant -> variant.outputs.all { //rename build to make it detect by flutter outputFileName = "../../flutter-apk/app-${variant.name}.apk" } } } 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 minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } bundle { // Profiler issues require us to temporarily package native code compressed to // match the previous APK packaging. // https://bugzilla.mozilla.org/show_bug.cgi?id=1865634 packagingOptions { jniLibs { it.useLegacyPackaging = true } } } packagingOptions { jniLibs { useLegacyPackaging true } } //Exclude dependenciesInfo for f-droid dependenciesInfo { // Disables dependency metadata when building APKs. includeInApk = false // Disables dependency metadata when building Android App Bundles. includeInBundle = false } } flutter { source = "../.." } //Override version code for f-droid ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3] import com.android.build.OutputFile android.applicationVariants.all { variant -> variant.outputs.each { output -> def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) if (abiVersionCode != null) { output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode } } }