From 9d7fc64b0b48fbcbd9cf37107dc0e9c76993f8bc Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 20 Jul 2026 18:35:41 +0200 Subject: [PATCH] =?UTF-8?q?release:=20cut=200.3.1=20=E2=80=94=20fix=20the?= =?UTF-8?q?=20launch=20crash=20in=20minified=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R8 kept androidx.work.impl.WorkDatabase_Impl but pruned its no-arg constructor: nothing calls it directly, Room only reaches it reflectively. Room then threw InstantiationException, surfacing as "Failed to create an instance of androidx.work.impl.WorkDatabase". WorkManager builds that database from a startup ContentProvider, so 0.3.0 died before any of our code ran — every install, every launch. We don't depend on WorkManager directly; it arrives via Glance. AGP 9's stricter R8 is what tipped this over, which is why 0.3.0 was the first release to hit it. Keep the Room no-arg constructor, and the ListenableWorker constructor alongside it — same pruning hazard on the path WorkManager uses to instantiate workers by name, which would have bitten once a Glance widget update actually ran. Reproduced the reporter's stack trace frame-for-frame on a releaseTest build, then confirmed it launches clean afterwards. Fixes #1. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 7 +++++++ app/build.gradle.kts | 4 ++-- app/proguard-rules.pro | 15 +++++++++++++++ .../metadata/android/en-US/changelogs/301.txt | 5 +++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/301.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index ec9d7d5..3d43a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ All notable changes to this project are documented here. The format follows ## [Unreleased] +## [0.3.1] - 2026-07-20 + +### Fixed +- Agendula no longer crashes on launch. Every 0.3.0 install was affected: the + release build stripped a constructor that the background-work scheduler needs + to open its database, and that happens before the app draws anything. + ## [0.3.0] - 2026-07-19 ### Added diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0a2fc28..557e4e7 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -29,8 +29,8 @@ android { // release itself (versionCode is pinned to MAJOR*10000 + MINOR*100 + // PATCH from versionName, e.g. 0.2.0 -> 200). The Gitea release is marked // as a pre-release while MAJOR is 0. See docs/RELEASING.md. - versionCode = 300 - versionName = "0.3.0" + versionCode = 301 + versionName = "0.3.1" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index dccc1da..d4314e3 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -2,5 +2,20 @@ -keep class dagger.hilt.** { *; } -keep @dagger.hilt.android.HiltAndroidApp class * +# Room instantiates its generated _Impl reflectively through a no-arg +# constructor. R8 under AGP 9 keeps the class but prunes that constructor, since +# nothing calls it directly — Room then throws InstantiationException, reported +# as "Failed to create an instance of ...". We pull Room in transitively via +# Glance -> WorkManager, whose WorkDatabase is built by WorkManagerInitializer +# at startup, so the app died on launch in every minified build (issue #1). +-keep class * extends androidx.room.RoomDatabase { (); } + +# WorkManager likewise looks its workers up by name and calls this constructor +# reflectively — same pruning, but it only bites once a worker actually runs +# (Glance's widget updates), so keep it explicitly rather than wait for it. +-keep class * extends androidx.work.ListenableWorker { + (android.content.Context, androidx.work.WorkerParameters); +} + # Compose Compiler may keep its own; defaults are fine -dontwarn org.jetbrains.annotations.** diff --git a/fastlane/metadata/android/en-US/changelogs/301.txt b/fastlane/metadata/android/en-US/changelogs/301.txt new file mode 100644 index 0000000..9bfebc3 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/301.txt @@ -0,0 +1,5 @@ +### Fixed +- Agendula no longer crashes on launch. Every 0.3.0 install was affected: the + release build stripped a constructor that the background-work scheduler needs + to open its database, and that happens before the app draws anything. +