fix(widgets): keep WorkManager's InputMerger constructor under R8

R8 under AGP 9 pruned the no-arg constructor of OverwritingInputMerger,
which WorkManager instantiates reflectively before running any worker.
Every Glance session worker then failed with "Could not create Input
Merger", no RemoteViews reached the host, and every widget showed
"Can't load widget" in minified builds. Debug builds were unaffected.
This commit is contained in:
2026-10-02 22:15:05 +02:00
parent a8bc652b22
commit a1337e7d9a
+6
View File
@@ -17,5 +17,11 @@
<init>(android.content.Context, androidx.work.WorkerParameters);
}
# Before a worker runs, WorkManager also instantiates its InputMerger by name
# through the no-arg constructor. With that pruned, every Glance session
# worker fails ("Could not create Input Merger"), no RemoteViews ever reach
# the host, and every widget shows "Can't load widget".
-keep class * extends androidx.work.InputMerger { <init>(); }
# Compose Compiler may keep its own; defaults are fine
-dontwarn org.jetbrains.annotations.**