fix(android-llmservice): monotonic versionCode for clean in-place upgrades#317
Merged
bernardladenthin merged 1 commit intoJul 10, 2026
Merged
Conversation
…rades
The release build hardcoded versionCode=1, so every APK advertised the
same version — one of the two reasons an in-place upgrade of a sideloaded
build failed (the installer shows the generic 'problem parsing the
package'). versionCode now derives from GITHUB_RUN_NUMBER in CI (strictly
increasing per run; -PappVersionCode overrides; local hand builds use 1).
The other half of clean upgrades is a STABLE signing key across builds:
without the upload-key CI secrets the release falls back to debug signing,
and a GitHub runner generates a fresh random debug key per build, so
consecutive APKs have different signers and Android rejects the update.
Documented in README ('In-place upgrades') and requirements.md R10.2/R10.4;
the actual key stays a private CI secret (never committed).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HTS5FpMtBLJENTGoRUrp5m
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixes the "there was a problem parsing the package" / must-uninstall-before-update symptom on the sideloaded app. There are two reasons Android rejects an in-place upgrade; this PR fixes the one that's a code issue and documents the other (which is a CI-secret setup, not code):
versionCodewas hardcoded to1→ every APK advertised the same version. Now derived fromGITHUB_RUN_NUMBERin CI (strictly increasing per run;-PappVersionCode=<n>overrides; local hand builds fall back to1), so successive release APKs advertise a higher code and Android accepts the update.ANDROID_UPLOAD_KEYSTORE_BASE64/…_STORE_PASSWORD/…_KEY_ALIAS/…_KEY_PASSWORDCI secrets (the CI wiring already decodes+signs with them) so every build shares one key. The key stays a private secret — never committed (the repo is public; a leaked signing key would let anyone ship a fake update). Documented inREADME.md("In-place upgrades") andrequirements.mdR10.2/R10.4.No behavior change for local/AndroidStudio builds (still
versionCode 1, debug-signed). Docs kept in sync per therequirements.mdrule.Test plan
versionCodeexpression uses the already-presentproviders.gradleProperty(...)pattern (same asjllamaVersion) +System.getenv("GITHUB_RUN_NUMBER"), fallback1build-android-llmservicecompiles the app (Gradle config-time read)README.md+requirements.mdRelated issues / PRs
Follow-up to the
android-llmserviceapp work (PRs #310–#316). Reported symptom: parse error when updating an already-installed build.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01HTS5FpMtBLJENTGoRUrp5m
Generated by Claude Code