Environment
Android app using WorkManager 2.7.0, targetSdk 30, minSdk 21. Devices tested: Pixel 3 (Android 11) and Samsung A (Android 11). Jobs scheduled with WorkManager.enqueueUniqueWork(..., ExistingWorkPolicy.KEEP, oneOffWorkRequest). App updated via Play Store; no Clear Data performed.
Symptoms
A one-off background task scheduled with WorkManager disappears after the app is updated through Play Store. The work no longer appears in WorkManager.getWorkInfosLiveData(...) and doesn't run. Rebooting the device does not restore the job. Scheduling the work again after update succeeds.
Observations
WorkManager database initially contained the work entry; after update the WorkManager DB (workdb) lacks that entry. Logs during update show application's process restarted and WorkManager reinitialization occurs. No migrations reported in logs. The issue appears only on Android 11 devices and only when WorkManager version was upgraded between app versions; identical app update without WorkManager version bump did not lose scheduled works in internal tests.
Already attempted
Tried reinitializing WorkManager in Application.onCreate(), verified WorkManager.initialize not called multiple times. Tried using enqueueUniqueWork with KEEP and REPLACE variants; behavior same. Upgrading WorkManager to latest stable (2.8.x) in a test branch preserved scheduled works across update in one trial but not consistently across devices.
Question
What causes WorkManager to drop scheduled one-off work entries during app update on Android 11 and how can I make scheduled tasks survive app updates reliably?
Verified community troubleshooting
No answers yet..