plugins { id "com.android.application" id "kotlin-android" 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' } def keystoreProperties = new Properties() // Prefer root key.properties, but fall back to android/key.properties if present (CI may place it there) def keystorePropertiesFile = rootProject.file('key.properties') if (!keystorePropertiesFile.exists()) { def alt = rootProject.file('android/key.properties') if (alt.exists()) { keystorePropertiesFile = alt } } if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } // Temporary debug task: prints which keystore file Gradle sees and whether the storeFile exists (does NOT print secrets) task printSigning { doLast { println "keystorePropertiesFile = ${keystorePropertiesFile}" println "keystoreProperties keys = " + keystoreProperties.keySet().toString() def store = keystoreProperties['storeFile'] println "storeFile = " + (store ?: 'null') if (store) { def f = new File(store) println "storeFile absolute = " + f.absolutePath println "storeFile exists = " + f.exists() // Also show whether the file exists when interpreted relative to the Gradle rootProject def f2 = new File(rootProject.projectDir, store) println "storeFile relative to rootProject = " + f2.absolutePath + " exists = " + f2.exists() } } } android { namespace "inventree.inventree_app" compileSdkVersion 35 compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } // If using Kotlin kotlinOptions { jvmTarget = JavaVersion.VERSION_17 } sourceSets { main.java.srcDirs += 'src/main/kotlin' } packagingOptions { exclude 'META-INF/proguard/androidx-annotations.pro' } lintOptions { disable 'InvalidPackage' } defaultConfig { applicationId "inventree.inventree_app" minSdkVersion 21 targetSdkVersion 35 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } 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.release } } } flutter { source '../..' } dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support:multidex:2.0.1' implementation "androidx.core:core:1.9.0" implementation 'androidx.appcompat:appcompat:1.6.0' }