fix: keep WorkManager's Room database constructor in release builds

This commit is contained in:
2026-10-20 10:36:20 +02:00
parent 9c17d65088
commit 0803d0f5ad
6 changed files with 79 additions and 19 deletions
+25 -10
View File
@@ -30,10 +30,11 @@ the rest are things you must do in the Play Console / with your own accounts.
## 2. Versioning
- [x] Set `versionName` (user-visible) **[code]** — `1.1.0` in `app/build.gradle.kts`.
- [x] `versionCode` **[code]** — currently **4**. It is the counter Play orders uploads by, and
every later upload must be higher. Codes 1–3 were consumed by 1.0.0–1.0.2, so the
freemium build takes **4**.
- [x] Set `versionName` (user-visible) **[code]** — `1.1.1` in `app/build.gradle.kts`.
- [x] `versionCode` **[code]** — currently **5**. It is the counter Play orders uploads by, and
every later upload must be higher. Codes 1–3 were consumed by 1.0.0–1.0.2, and **4** by
the 1.1.0 internal-testing build (which crashed on startup, see step 3), so the fixed
freemium build takes **5**.
## 3. Build the release artefacts
@@ -42,17 +43,25 @@ the rest are things you must do in the Play Console / with your own accounts.
./gradlew :app:assembleRelease # -> APK for local testing
```
- [ ] **Build and record the 1.1.0 artefacts.** The 1.0.2 record is historical
- [ ] **Build and record the 1.1.1 artefacts.** The 1.0.2 record is historical
(2,940,935 bytes, `sha256 534e5ae9…`). The freemium build adds the ads/UMP/Billing
dependencies and the AdMob manifest entry, so its size and hash must be re-measured
after real AdMob ids are configured. Verify the release APK reports package
`de.softwareapp_hb.fotodup.finder.free`, `versionCode=4 versionName=1.1.0
`de.softwareapp_hb.fotodup.finder.free`, `versionCode=5 versionName=1.1.1
targetSdk=36` and the permission set in step 5 (including `INTERNET`, `AD_ID` and
`BILLING`).
Local validation with the default test ids (2026-10-20): APK 3,655,562 bytes,
`sha256 931d2b21…`; signed AAB 7,680,301 bytes, `sha256 03abb548…`.
Re-measure both after setting the real ids/cutoff — the ids change the manifest and
therefore the artefacts.
The 1.1.0 validation build (`versionCode` 4, test ids) was a 3,655,562-byte APK /
7,680,301-byte AAB, but it **crashed on launch** and must not be reused:
R8 removed `androidx.work.impl.WorkDatabase_Impl`'s no-arg constructor, which
WorkManager creates reflectively from `androidx.startup.InitializationProvider`.
`app/proguard-rules.pro` now keeps it. The 1.1.1 test-id validation build
(`versionCode` 5) is a 3,688,330-byte APK (`sha256 ee87b0eb…`) / 7,752,081-byte
AAB (`sha256 39223adb…`); `dexdump` confirms the `WorkDatabase_Impl` public
no-arg constructor is present. Re-measure both artefacts with the real ids/cutoff.
- [ ] **Launch the minified build before uploading.** Do not rely on
`assembleDebug`/unit tests: they do not run R8. Install the release APK on a
real device (or a temporarily minified debug build side by side) and confirm it
gets past the splash screen to the scanner/UMP consent. See `AGENTS.md` §9.
- [ ] Upload the **`.aab`** (not the APK) to the Play Console.
⚠️ **Expect a native-debug-symbols warning here, and ignore it.** Play scans the bundle, finds
`base/lib/<abi>/libandroidx.graphics.path.so`, and reports *"This App Bundle contains native
@@ -491,6 +500,12 @@ action except the items marked **[code]**.
- [ ] Create an **internal testing** track and add yourself as a tester; install via
the Play link on a real device.
- [ ] **Confirm the first screen appears.** The 1.1.0 upload (`versionCode` 4) installed
but crashed before `Application.onCreate`; versionCode 5 keeps WorkManager's
`WorkDatabase_Impl` constructor so it gets past
`androidx.startup.InitializationProvider`. If a future release crashes the same
way, check the R8 keep rule and `app/build/outputs/mapping/release/usage.txt` for
`WorkDatabase_Impl`.
- [ ] Test on the oldest supported Android version you can (minSdk 26) and on the
newest you have (Android 16 / API 36).
- [ ] Test the permission flows: