Files
Eventify-frontend/android/app/build.gradle.kts
Sicherhaven 6990b62645 fix(android): read versionCode/versionName from flutter pubspec instead of hardcoded values
Was hardcoded to versionCode=17, versionName="1.6.1(p)" — overriding
pubspec.yaml and causing Play Store rejection. Now reads flutter.versionCode
and flutter.versionName so pubspec.yaml is the single source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 21:36:25 +05:30

64 lines
2.0 KiB
Kotlin

plugins {
id("com.android.application")
id("kotlin-android")
id("dev.flutter.flutter-gradle-plugin")
}
android {
namespace = "com.sicherhaven.eventify"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
defaultConfig {
applicationId = "com.sicherhaven.eventify"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
// ---------- SIGNING CONFIG ----------
signingConfigs {
create("release") {
// path relative to android/app/
storeFile = file("upload-keystore-new.jks")
// Read from gradle.properties or environment variables.
@Suppress("UNCHECKED_CAST")
val storePwd = (project.findProperty("KEYSTORE_PASSWORD") ?: System.getenv("KEYSTORE_PASSWORD")) as String?
val alias = (project.findProperty("KEY_ALIAS") ?: System.getenv("KEY_ALIAS")) as String?
val keyPwd = (project.findProperty("KEY_PASSWORD") ?: System.getenv("KEY_PASSWORD")) as String?
// If any are null/empty the build will fail; keep empty strings to avoid null issues,
// but ensure you provided values in gradle.properties or env.
storePassword = storePwd ?: ""
keyAlias = alias ?: ""
keyPassword = keyPwd ?: ""
}
}
buildTypes {
release {
// Use the release signing config created above
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
}
flutter {
source = "../.."
}