ci: attach the r8 mapping to android releases

Release APKs are obfuscated since R8 was turned on, and nothing kept
the mapping that decodes their stack traces. The workflow now copies
`android/app/build/outputs/mapping/release/mapping.txt` to
`bulwark-mobile-<version>-<commit>-mapping.txt`, uploads it as a
workflow artifact and attaches it to the release next to the APK. The
in-app updater only picks `.apk` assets, so it ignores the new file.

If R8 is on (`android.enableMinifyInReleaseBuilds=true`) and no mapping
was written, the step fails instead of publishing an APK whose crashes
cannot be read. docs/android-release.md explains how to decode a trace
with `retrace`.
This commit is contained in:
Linus Rath
2026-09-24 22:14:35 +02:00
parent a764a07c65
commit e5659ed5e8
2 changed files with 49 additions and 3 deletions
+17
View File
@@ -237,6 +237,23 @@ either.
With neither, a release build stops and lists what is missing. Debug builds and
`npx expo run:android` never need any of this.
## Stack traces
Release builds are shrunk and obfuscated by R8, so library frames in a crash
report look like `com.facebook.react.uimanager.U.a`. The app's own classes
(`com.anonymous.bulwarkmobile`) keep their names. The workflow attaches
`bulwark-mobile-<version>-<commit>-mapping.txt` to the release next to the APK
and keeps it as a workflow artifact. Decode a trace with the mapping of that
exact build:
```bash
retrace bulwark-mobile-0.1.63-abc1234-mapping.txt stacktrace.txt
```
`retrace` is in the Android SDK command-line tools (`cmdline-tools/latest/bin`).
A local build writes its mapping to
`android/app/build/outputs/mapping/release/mapping.txt`.
## versionCode
`versionCode` was `1` for every release up to 0.1.62. It is now derived from