From b519104c648a90d2e77184170a6a73e6334594a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:12:08 +0200 Subject: [PATCH] fix(android): raise minSdkVersion to 24 so Play accepts the bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Play automatic protection rejects an App Bundle below API 24, so the 0.7.0 .aab could not be uploaded. Raise SupportedOSPlatformVersion to 24 and drop the minSdkVersion the manifest hardcoded: like versionCode, a value declared there overrides the csproj, so the csproj alone would not have moved it. release.yml now reads the APK's minSdkVersion with aapt2 and refuses a floor below 24, so a regression fails the build instead of the upload. It accepts both badging spellings (minSdkVersion: from current build-tools, sdkVersion: from older ones). Android 6.0 devices can no longer install the app; README updated. Fixes #550 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --- .github/workflows/release.yml | 5 +++++ README.md | 2 +- changelog.d/+android-min-sdk-24.changed.md | 1 + src/LageBuch.App.Android/AndroidManifest.xml | 6 ++++-- src/LageBuch.App.Android/LageBuch.App.Android.csproj | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 changelog.d/+android-min-sdk-24.changed.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62e1d28d..0f444c84 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -215,6 +215,11 @@ jobs: for abi in armeabi-v7a arm64-v8a x86_64; do unzip -l "$apk" "lib/$abi/*" > /dev/null || { echo "::error::The APK has no lib/$abi - check RuntimeIdentifiers"; exit 1; } done + # Play automatic protection rejects a bundle whose minSdkVersion is below 24, and 0.7.0 + # only found out at the Play upload (#550). The .apk is rendered from the same bundle. + aapt2=$(ls -d "$ANDROID_HOME"/build-tools/*/aapt2 | sort -V | tail -n1) + min_sdk=$("$aapt2" dump badging "$apk" | sed -n "s/^\(minSdkVersion\|sdkVersion\):'\([0-9]*\)'$/\2/p") + test "${min_sdk:-0}" -ge 24 || { echo "::error::The APK has minSdkVersion '${min_sdk}', Play needs 24 - check SupportedOSPlatformVersion"; exit 1; } mkdir -p dist play cp "$apk" "dist/lagebuch-${VERSION}.apk" cp "$aab" "play/lagebuch-${VERSION}.aab" diff --git a/README.md b/README.md index 166c0a98..9b517c2c 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ Betriebssystem beim ersten Start einmal: `dpkg -i`: das Paket deklariert seine Systemabhängigkeiten (ICU, fontconfig, X11-Bibliotheken), die nur `apt` auflöst. Falls doch `dpkg -i`: `sudo apt-get -f install` räumt auf. -- **Android** – ab Android 6.0 (API 23); `.apk` öffnen und die Installation +- **Android** – ab Android 7.0 (API 24); `.apk` öffnen und die Installation aus unbekannten Quellen für diese App einmal erlauben. Die Android-App ist ein Begleitgerät: sie verbindet sich mit einem Einsatz, der auf einem Laptop gehostet wird. diff --git a/changelog.d/+android-min-sdk-24.changed.md b/changelog.d/+android-min-sdk-24.changed.md new file mode 100644 index 00000000..6ebceb59 --- /dev/null +++ b/changelog.d/+android-min-sdk-24.changed.md @@ -0,0 +1 @@ +The Android app now requires Android 7.0 (API 24), the minimum Google Play accepts for a new release, so the 0.7 line can be published there (#550). diff --git a/src/LageBuch.App.Android/AndroidManifest.xml b/src/LageBuch.App.Android/AndroidManifest.xml index 6159e5cf..814156b4 100644 --- a/src/LageBuch.App.Android/AndroidManifest.xml +++ b/src/LageBuch.App.Android/AndroidManifest.xml @@ -4,9 +4,11 @@ -p:ApplicationVersion, -p:ApplicationDisplayVersion and $(ApplicationId) from the csproj and the release workflow. That is exactly what happened: every published APK up to and including lagebuch-0.6.0.apk reported versionName 0.1.0 / versionCode 1, whatever its tag said. The - csproj is the only source of truth; the tag feeds it through release.yml. --> + csproj is the only source of truth; the tag feeds it through release.yml. + minSdkVersion is absent for the same reason: $(SupportedOSPlatformVersion) sets it. Play + automatic protection refuses a bundle below API 24 (#550), and release.yml checks the floor. --> - + 1 0.0.0 - 23 + 24