From 53a7db154fed5d8aba41a2ea41c79ee2347a4c9c Mon Sep 17 00:00:00 2001 From: "Omer I.S." Date: Thu, 12 Feb 2026 23:21:35 +0200 Subject: [PATCH 1/8] Fix build #6 --- android/app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 52d88d1c..065d9139 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -39,7 +39,7 @@ android { targetCompatibility = JavaVersion.VERSION_17 } - compilerOptions { + kotlinOptions { jvmTarget = JavaVersion.VERSION_17.toString() } @@ -133,7 +133,7 @@ val abiCodes = mapOf("x86_64" to 1, "armeabi-v7a" to 2, "arm64-v8a" to 3) android.applicationVariants.configureEach { val variant = this variant.outputs.forEach { output -> - val abiVersionCode = abiCodes[output.filters.find { it.filterType == ABI }?.identifier] + val abiVersionCode = abiCodes[output.filters.find { it.filterType.name == "ABI" }?.identifier] if (abiVersionCode != null) { // Create a version code within Android limits (max 2100000000) // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits From c61d6b0dca1c1c0d60e752565dcef8db6de765d5 Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Thu, 12 Feb 2026 23:36:43 +0200 Subject: [PATCH 2/8] Update android/app/build.gradle.kts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- android/app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 065d9139..f8e870cd 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -39,8 +39,8 @@ android { targetCompatibility = JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() + kotlin { + jvmToolchain(17) } defaultConfig { From 0de1d97db75b5e9a808007bdfd48fe7df9655653 Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Thu, 12 Feb 2026 23:38:24 +0200 Subject: [PATCH 3/8] Update android/app/build.gradle.kts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- android/app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f8e870cd..07c9fee3 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -133,7 +133,7 @@ val abiCodes = mapOf("x86_64" to 1, "armeabi-v7a" to 2, "arm64-v8a" to 3) android.applicationVariants.configureEach { val variant = this variant.outputs.forEach { output -> - val abiVersionCode = abiCodes[output.filters.find { it.filterType.name == "ABI" }?.identifier] + val abiVersionCode = abiCodes[output.filters.find { it.filterType == "ABI" }?.identifier] if (abiVersionCode != null) { // Create a version code within Android limits (max 2100000000) // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits From 4c6f0afaf1f966bdd6565a8234510ee9e33cee09 Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Thu, 12 Feb 2026 23:38:37 +0200 Subject: [PATCH 4/8] Update android/app/build.gradle.kts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- android/app/build.gradle.kts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 07c9fee3..b0b172a8 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -129,14 +129,24 @@ android { } val abiCodes = mapOf("x86_64" to 1, "armeabi-v7a" to 2, "arm64-v8a" to 3) - -android.applicationVariants.configureEach { - val variant = this - variant.outputs.forEach { output -> - val abiVersionCode = abiCodes[output.filters.find { it.filterType == "ABI" }?.identifier] - if (abiVersionCode != null) { - // Create a version code within Android limits (max 2100000000) - // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits +androidComponents { + onVariants { variant -> + variant.outputs.forEach { output -> + val abiFilter = output.filters.find { + it.filterType == com.android.build.api.variant.VariantOutputConfiguration.FilterType.ABI + } + val abiVersionCode = abiFilter?.identifier?.let { abiCodes[it] } + + if (abiVersionCode != null) { + // Create a version code within Android limits (max 2100000000) + // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits + val baseBuildNumber = flutterVersionCode.toLong() + val compressedCode = (baseBuildNumber % 100000) * 100 + abiVersionCode + output.versionCode.set(compressedCode.toInt()) + } + } + } +} val baseBuildNumber = flutterVersionCode.toLong() val compressedCode = (baseBuildNumber % 100000) * 100 + abiVersionCode (output as ApkVariantOutputImpl).versionCodeOverride = compressedCode.toInt() From 038f9fb8e2cd35026b51a8864071c52fc42a6c1e Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:00:32 +0200 Subject: [PATCH 5/8] Update android/app/build.gradle.kts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- android/app/build.gradle.kts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index b0b172a8..d046ba88 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -140,9 +140,10 @@ androidComponents { if (abiVersionCode != null) { // Create a version code within Android limits (max 2100000000) // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits - val baseBuildNumber = flutterVersionCode.toLong() + val baseBuildNumber = flutterVersionCode.toLongOrNull() ?: 1L val compressedCode = (baseBuildNumber % 100000) * 100 + abiVersionCode - output.versionCode.set(compressedCode.toInt()) + val safeVersionCode = compressedCode.coerceIn(1L, Int.MAX_VALUE.toLong()) + output.versionCode.set(safeVersionCode.toInt()) } } } From ce424a680f0c80b5c9e7fb82b4bfe9a9a3fbd3b3 Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:12:41 +0200 Subject: [PATCH 6/8] Update build.gradle.kts --- android/app/build.gradle.kts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d046ba88..3d680384 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -148,12 +148,6 @@ androidComponents { } } } - val baseBuildNumber = flutterVersionCode.toLong() - val compressedCode = (baseBuildNumber % 100000) * 100 + abiVersionCode - (output as ApkVariantOutputImpl).versionCodeOverride = compressedCode.toInt() - } - } -} dependencies { From 5c276d5a99f3df978542b592cc3476d5a4f805cb Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:17:54 +0200 Subject: [PATCH 7/8] Update android/app/build.gradle.kts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- android/app/build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 3d680384..66f38d60 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -142,7 +142,8 @@ androidComponents { // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits val baseBuildNumber = flutterVersionCode.toLongOrNull() ?: 1L val compressedCode = (baseBuildNumber % 100000) * 100 + abiVersionCode - val safeVersionCode = compressedCode.coerceIn(1L, Int.MAX_VALUE.toLong()) + val maxPlayVersionCode = 2_100_000_000L + val safeVersionCode = compressedCode.coerceIn(1L, maxPlayVersionCode) output.versionCode.set(safeVersionCode.toInt()) } } From c8b74b91353b0a1f7a661c72243f7515b9d84ebd Mon Sep 17 00:00:00 2001 From: "Omer I.S." <137101815+omeritzics@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:18:26 +0200 Subject: [PATCH 8/8] Update android/app/build.gradle.kts Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com> --- android/app/build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 66f38d60..5a8ba661 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -140,7 +140,9 @@ androidComponents { if (abiVersionCode != null) { // Create a version code within Android limits (max 2100000000) // Use: (YYMMDDHH % 100000) * 100 + ABI to stay well under limits - val baseBuildNumber = flutterVersionCode.toLongOrNull() ?: 1L + val baseBuildNumber = requireNotNull(flutterVersionCode.toLongOrNull()) { + "Invalid flutter.versionCode='$flutterVersionCode' in local.properties; must be a number." + } val compressedCode = (baseBuildNumber % 100000) * 100 + abiVersionCode val maxPlayVersionCode = 2_100_000_000L val safeVersionCode = compressedCode.coerceIn(1L, maxPlayVersionCode)