fix(widget): widgets stuck on loading spinner in release build (#18) #22
Reference in New Issue
Block a user
Delete Branch "fix/widget-release"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #18 — home-screen widgets showed only a loading spinner in the published F-Droid (R8-minified) release build, while working fine in debug.
Root cause
Glance renders every widget through a WorkManager worker (
androidx.glance.session.SessionWorker). Before running a worker, WorkManager instantiates its InputMerger reflectively from the fully-qualified class name stored in the WorkSpec (Class.newInstance(), no-arg constructor). Under R8 full mode (AGP 9 default), the unused no-arg constructor ofandroidx.work.OverwritingInputMergerwas stripped, so:The SessionWorker never ran →
provideContentnever executed → the widget stayed on its initial loading layout (glance_default_loading_layout, a spinner) forever. Same R8-reflection family as the v2.7.0 Room keep-rule fix.Fix
Keep the name + constructor of every
androidx.work.InputMerger(one proguard rule).Verification (three-way, on-device)
Built the R8-minified
releaseTestvariant and compared widgets side by side:SessionWorker SUCCESS— renders.Cuts v2.7.3 (CHANGELOG + version bump + fastlane changelog included).