WorkManager not working when app killed in Android 10 although working fine till version 9 (Pie)
Asked Answered
O

1

7

I figured out this issue when I wasnt getting the notification through workmanager when the app was killed from background tasks in Android 10.

It is working fine for all the android version till Andorid 9. To test this, I run the app simultaneously on both 9 and 10 versions.

Is someone else also facing this issue? I searched the web but no support solution for Andorid 10 based issue.

Note: As soon as the app is opened and the workmanager is triggered, I get the notification in 10 but not when the app is completely closed. Also, I have tested this scenario on Google Pixel device as well for Android 10 but no success.

Obstacle answered 29/7, 2020 at 6:14 Comment(5)
Any solution? Facing the same issueAnkledeep
one difference in logs i noticed is that when the app is killed from background tasks, The workmanager doWork() is not called due to which the issue is coming. Trying to fix that. Pls do upvote the ans to attract more people for the solution if u r facing the same issue then.Obstacle
The exact same problem.. Please any solution for this?!Zulazulch
Is your device by chance in power saving mode? See #66030982.Belted
Can you please add code or more detail to this question. What sort of notification? What behavior are you seeing and which version of WorkManager are you using?Spicer
C
1

There is vast fragmentation in the android world. The background task management is the worst scenario as it will behave different in different devices. Please read the post below to get better understanding.

Chops answered 3/8, 2020 at 4:58 Comment(2)
I am facing this in Googles Pixel devices and also on all the devices with android 10. Thank you for this!Obstacle
Try batter optimization setting. If app is optimized in background it will be killed to save battery. App should not be optimized in background.Chops

© 2022 - 2024 — McMap. All rights reserved.