plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' // last is probably not needed } def localPropertiesFile = rootProject.file('local.properties') def localProperties = new Properties() if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } else { throw new GradleException("local.properties not found") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } def secretPropertiesFile = rootProject.file('secrets.properties') def fallbackPropertiesFile = rootProject.file('fallback.properties') def secretProperties = new Properties() if (secretPropertiesFile.exists()) { secretPropertiesFile.withReader('UTF-8') { reader -> secretProperties.load(reader) } } else if (fallbackPropertiesFile.exists()) { fallbackPropertiesFile.withReader('UTF-8') { reader -> secretProperties.load(reader) } } else { throw new GradleException("Secrets file (secrets.properties, fallback.properties) not found") } android { namespace "com.anydev.anyway" compileSdk flutter.compileSdkVersion ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { applicationId "com.anydev.anyway" // 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. // Minimum Android version for Google Maps SDK // https://developers.google.com/maps/flutter-package/config#android minSdk = 21 minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName // // Placeholders of keys that are replaced by the build system. manifestPlaceholders += ['MAPS_API_KEY': System.getenv('ANDROID_GOOGLE_MAPS_API_KEY')] } signingConfigs { release { keyAlias = secretProperties['keyAlias'] keyPassword = secretProperties['keyPassword'] storeFile = secretProperties['storeFile'] ? file(secretProperties['storeFile']) : null storePassword = secretProperties['storePassword'] } } buildTypes { release { signingConfig = signingConfigs.release } } } flutter { source '../..' } dependencies {}