fix(android): remove hardcoded versionCode/Name from manifest so aapt2 CI injection works
Android Release / build-apk (push) Successful in 3m44s

aapt2 --version-code/--version-name only inject when the attribute is
absent — they silently no-op when the manifest already has a value.
Removed both attributes from AndroidManifest.xml so the CI flags take
effect. Local debug builds fall back to code=1 / name=0.0.0-dev.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-16 12:11:22 -07:00
parent 24d83c9ae3
commit faefca0445
2 changed files with 7 additions and 5 deletions
+6 -2
View File
@@ -76,12 +76,16 @@ if [ -d "$RES_DIR" ]; then
fi
# Derive versionCode/versionName from VERSION_NAME env var (e.g. "v0.28.0" → code 2800, name "0.28.0").
# Falls back to the values hardcoded in AndroidManifest.xml when not set (local debug builds).
VERSION_CODE=""
# AndroidManifest.xml intentionally has no versionCode/versionName — aapt2's --version-* flags only
# inject when absent, so the manifest must be clean for CI injection to work. Local debug builds
# fall back to code=1 / name="0.0.0-dev".
if [ -n "${VERSION_NAME:-}" ]; then
VN="${VERSION_NAME#v}"
IFS='.' read -r _MAJ _MIN _PAT <<< "$VN"
VERSION_CODE=$(( ${_MAJ:-0} * 10000 + ${_MIN:-0} * 100 + ${_PAT:-0} ))
else
VERSION_CODE=1
VERSION_NAME="0.0.0-dev"
fi
LINK_ARGS=(
+1 -3
View File
@@ -13,9 +13,7 @@
shared object name without the `lib` prefix or `.so` suffix.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ferrousapp.solitaire"
android:versionCode="1"
android:versionName="1.0">
package="com.ferrousapp.solitaire">
<uses-sdk
android:minSdkVersion="26"