fix(widget): keep WorkManager InputMerger so widgets render under R8 (#18)
All checks were successful
CI / ci (pull_request) Successful in 8m45s
All checks were successful
CI / ci (pull_request) Successful in 8m45s
Home-screen widgets were stuck on the Glance loading layout (a blank spinner) in the minified release build — but worked in debug. Root cause: Glance renders every widget through a WorkManager worker (androidx.glance.session.SessionWorker), and WorkManager instantiates the InputMerger reflectively from the fully-qualified class name persisted in the WorkSpec (Class.newInstance, no-arg ctor). Under R8 full mode (AGP 9 default) the unused no-arg constructor of androidx.work.OverwritingInputMerger was stripped, so WorkManager threw "OverwritingInputMerger has no zero argument constructor", the SessionWorker never ran, and provideContent never executed — leaving the widget on its initial loading layout forever. Same R8-reflection family as the v2.7.0 Room keep-rule fix. Keep the name + constructor of every androidx.work.InputMerger. Verified on-device with the releaseTest build (R8-minified): the agenda widget, which showed only a spinner before, now renders its content; the WM-InputMerger InstantiationException is gone. Closes #18. Cuts v2.7.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
fastlane/metadata/android/en-US/changelogs/20703.txt
Normal file
6
fastlane/metadata/android/en-US/changelogs/20703.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
### Fixed
|
||||
- Home-screen widgets no longer get stuck on a loading spinner in the published
|
||||
(F-Droid) release build. They render via Android's background-work system, and
|
||||
release optimisation (R8) was stripping a helper class it loads by name, so the
|
||||
render job never ran. Added the missing keep rule — widgets now load normally.
|
||||
|
||||
Reference in New Issue
Block a user