Fix uninstallable update APKs built on the ARM64 runner #23

Merged
nezumi merged 1 commit from fix/release-apk-missing-resources into dev 2026-11-22 03:32:28 +00:00
Owner

Problem

Self-update downloads the APK but installation fails. The published karatv-1.0.1.apk (and karatv-0.3.4.apk) contain only dex files: no AndroidManifest.xml, resources.arsc or res/, so Android cannot install them.

Root cause

Two Forgejo runners share the docker label. v0.3.4 and v1.0.1 were built on the ARM64 runner, which swaps in the third-party AAPT2 35.0.2 (scripts/ci-aapt2-arm64.sh); under AGP 9.5 it silently produces APKs without resources while the build still succeeds. v1.0.0 was built on the x86_64 runner with Maven AAPT2 and is fine (release runs 20/54 vs 45).

Changes

  • release.yml: job runs on runs-on: amd64 (x86_64 runner only).
  • release.yml: new Verify APK step fails the release if the APK lacks AndroidManifest.xml, resources.arsc or classes.dex (checked against the real 1.0.0 = pass, 1.0.1 = fail).
  • UpdateManager: before installing, parse the downloaded APK with getPackageArchiveInfo and require same package + newer versionCode; otherwise show the retry error instead of a failing system install.
  • docs/release.md: documents the amd64 label requirement and why.

Before merging

  • Add label amd64 to the x86_64 runner (e.g. amd64:docker://node:20-bookworm), otherwise the release job waits forever.
  • After release, v1.0.2 replaces the broken v1.0.1; consider deleting the v1.0.1 release.

Verification

  • compileDebugKotlin + testDebugUnitTest: pass (local).
  • Not verified on device; release job on the amd64 runner not run yet.
## Problem Self-update downloads the APK but installation fails. The published `karatv-1.0.1.apk` (and `karatv-0.3.4.apk`) contain only dex files: no `AndroidManifest.xml`, `resources.arsc` or `res/`, so Android cannot install them. ## Root cause Two Forgejo runners share the `docker` label. v0.3.4 and v1.0.1 were built on the **ARM64** runner, which swaps in the third-party AAPT2 35.0.2 (`scripts/ci-aapt2-arm64.sh`); under AGP 9.5 it silently produces APKs without resources while the build still succeeds. v1.0.0 was built on the **x86_64** runner with Maven AAPT2 and is fine (release runs 20/54 vs 45). ## Changes - `release.yml`: job runs on `runs-on: amd64` (x86_64 runner only). - `release.yml`: new **Verify APK** step fails the release if the APK lacks `AndroidManifest.xml`, `resources.arsc` or `classes.dex` (checked against the real 1.0.0 = pass, 1.0.1 = fail). - `UpdateManager`: before installing, parse the downloaded APK with `getPackageArchiveInfo` and require same package + newer versionCode; otherwise show the retry error instead of a failing system install. - `docs/release.md`: documents the `amd64` label requirement and why. ## Before merging - Add label `amd64` to the x86_64 runner (e.g. `amd64:docker://node:20-bookworm`), otherwise the release job waits forever. - After release, v1.0.2 replaces the broken v1.0.1; consider deleting the v1.0.1 release. ## Verification - `compileDebugKotlin` + `testDebugUnitTest`: pass (local). - Not verified on device; release job on the `amd64` runner not run yet.
Fix uninstallable update APKs built on the ARM64 runner
All checks were successful
CI / build (pull_request) Successful in 4m37s
46b3e9c543
The v0.3.4 and v1.0.1 release APKs contain only dex files (no
AndroidManifest.xml, resources.arsc or res/), so installing the update
fails. Both were built on the ARM64 runner, whose AAPT2 35.0.2 replacement
silently drops resources under AGP 9; v1.0.0 built on the x86_64 runner
is fine.

- Release job runs on the x86_64 runner (label `amd64`).
- New "Verify APK" step refuses to publish an APK without manifest,
  resources or dex.
- The app checks the downloaded APK (parseable, same package, newer
  versionCode) before starting the install, and shows retry otherwise.

Vi: Sửa lỗi APK cập nhật không cài được do build trên runner ARM64
nezumi deleted branch fix/release-apk-missing-resources 2026-11-22 03:32:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nezumi/kara-tv-app!23
No description provided.