Questions tagged [android-workmanager]

Android Jetpack WorkManager is used for scheduling and managing one time and periodic background tasks.

android-workmanager
593 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
18 votes
1 answer
1k views

WorkManager - SystemForegroundService: Context.startForegroundService() did not then call Service.startForeground()

For fetching the location from foreeground service, we have recently migrated our WorkManager to use ForegroundService. We have followed the below document to achieve this: https://developer.android....
Chandra Sekhar's user avatar
14 votes
2 answers
9k views

The file system on the device is in a bad state. WorkManager cannot access the app's internal data store

When I added work manager library to android studio and run the app it crashes with this error: E/SQLiteLog: (14) cannot open file at line 37816 of [c255889bd9] (14) os_unix.c:37816: (13) lstat(/...
ameencarpenter's user avatar
13 votes
0 answers
3k views

Saving data to Room from androidx.work.Worker fails

I´ve tried saving data from a Worker to Room database. Versions: Work Runtime Ktx - android.arch.work:work-runtime-ktx:1.0.0-alpha02 Room - android.arch.persistence.room:runtime:1.1.0 and android....
reixa's user avatar
  • 6,983
10 votes
0 answers
690 views

IllegalStateException: The file system on the device is in a bad state. WorkManager cannot access the app's internal data store

My app is not going to open. When i try to open app it immediately close with below crash. It is happening in only one device Redmi note 10s.(Android 11) It seems issue with Workmanager, but didn't ...
Bhavesh Jabuvani's user avatar
10 votes
1 answer
2k views

Why workers in work manager still in ENQUEUED state?

I'm creating OneTimeWorkRequest with NetworkType.CONNECTED constraint, but even though the device is connected to the internet, the request is still in ENQUEUED state Constraints constraints = new ...
ABOD's user avatar
  • 113
9 votes
0 answers
6k views

Android WorkManager not starting the worker

I want to download certain files from the server at the start of the app .So I tried using Work Manager which gets enqueued from my custom Application class.But the Worker class is not getting ...
adi's user avatar
  • 1,050
9 votes
1 answer
4k views

When does Android's WorkerManager stop a Worker?

We have an Android app using WorkManager to handle background sync work. Our sync worker is like this: public class SyncWorker extends Worker { [...] @NonNull @Override public ...
Paolone's user avatar
  • 485
9 votes
0 answers
742 views

WorkManager - Can WorkRequest maximum backoff time for retries be changed?

I'm using WorkManager to queue up OneTimeWorkRequests for file uploads. This of course requires network connectivity, and if the device does not have connectivity and the upload fails, it will retry ...
Pewpewkatchu's user avatar
8 votes
0 answers
6k views

android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false

I have upgrade the Android SDK project 30 to 31 and I also used permission in manifest: . which is required for targeting SDK 28 and above. In Android 12 I am getting the frequently below crashes on ...
manoj's user avatar
  • 81
8 votes
0 answers
748 views

WorkManager doWork getting fired twice

My goal is to run a simple task once an hour. At application start, I register an unique periodic work with ExistingPeriodicWorkPolicy.KEEP flag. Here's my implementation: public class MyWorker ...
Sanlok Lee's user avatar
  • 3,454
8 votes
3 answers
2k views

PeriodicWork with enqueueUniquePeriodicWork doesn't work

I'm trying to use WorkManger by creating a periodic Worker that repeats once every 5 days. I am using version 1.0.0 of workmanagers on a Huawei Android 7 device (API 24) android.arch.work:work-...
smoke89's user avatar
  • 121
8 votes
2 answers
792 views

WorkManager custom constraint

Is it possible to set some custom constraints (conditions) on workers? In my case, I want the worker to be only executed when there are some data available in a table in Room database. I could ...
Neno0o's user avatar
  • 133
7 votes
0 answers
829 views

How does WorkManager's setRequiresDeviceIdle(true) work?

I need to run a specific work only if the device is not in use. However, I don't fully understand how the .setRequiresDeviceIdle() constraint works. I'm scheduling a worker like this: val constraints =...
pjpires's user avatar
  • 313
7 votes
0 answers
3k views

How to update data from Retrofit periodically in MVVM using WorkManager?

Help me out please. I have a simpe Retrofit->Repository->MVVM->Fragment app. What it does is provides current weather from OpenWeatherApi. I have my LiveData in my ViewModel observed via Data Binding. ...
Waldmann's user avatar
  • 1,722
7 votes
1 answer
2k views

doWork() method is not getting called from Work Manager

I am trying to make server call using WorkManager. So, I wrote the below Worker class: class ServerCallWorker extends Worker { public ServerCallWorker(@NonNull Context context, @NonNull ...
Arindam Mukherjee's user avatar
6 votes
0 answers
516 views

ActivityThread crashes

Have been getting some ActivityThread crashes of which I cannot make much sense. Some of them point to third party libraries which do periodic work like Workmanager, Firebase etc. Root cause of most ...
Arka Prava Basu's user avatar
6 votes
0 answers
389 views

multiple notifications in a foreground worker

I am using a worker manager to upload videos along with a notification. When the user tries to upload a video again with an ongoing upload worker job the notification for the second upload is not ...
Krishna Saladi's user avatar
6 votes
1 answer
1k views

WorkManager not initialized exception even though WorkManagerInitializer not disabled in manifest

I got an app that uses WorkManager for several background tasks. Lately I see a lot of crashes in my production logs due to WM not being initialized even though I did not disable ...
SimonSays's user avatar
  • 10.9k
6 votes
0 answers
6k views

how to use retrofit in work manager to post some local messages to server one by one?

In my chat app, I want to read messages from the local database and send them to the server by the work manager and retrofit when the user sends new messages. in parent : OneTimeWorkRequest ...
Reza Rad's user avatar
6 votes
0 answers
2k views

Worker manager: not start work in enqueue

I have such code, I need to implement the task queue, if the task is in the queue, then you do not need to add it. I implemented as shown in when, everything works, but sometimes the state of the ...
Mher Arsh's user avatar
  • 598
6 votes
0 answers
440 views

Work manager periodic task not working on Samsung( Android version 9.0)

I configured a periodic work manager request and seems like it's working on Pixel(Android version 9.0) but fails on Samsung device which is also running on 9.0 //Work manager request final ...
Nikhil's user avatar
  • 91
6 votes
0 answers
621 views

Video Processing in background with work manager using ffmpeg

The problem comes when during the video processing user closes the application himself from the task manager then its processing stops. I am working on video file processing in android using FFMpeg, ...
Naseer Attari's user avatar
6 votes
0 answers
444 views

WorkManager Cursor window allocation of 2048 kb failed

I used WorkManager version android.arch.work:work-runtime:1.0.0-beta03.I used this workmanager for uploading files to server with dynamic interval time using OneTimeWorker. This is what I do. Hope ...
Harry T.'s user avatar
  • 3,507
6 votes
1 answer
2k views

How can I test Android WorkManager with setRequiredNetworkType(NetworkType.CONNECTED) constraint?

I am trying to write Android instrumentation tests for a class that contains WorkManager WorkRequests. For a long time I was stuck at the point where I could see the workers being enqueued but they ...
Paul Frank Allan's user avatar
6 votes
2 answers
7k views

Download file using WorkManager

I am working/trying with download a file with pause and resume functionality using WorkManager with MVVM. Here I am seeking pause/resume and download percentage progress update with use of ...
Karthikeyan Ve's user avatar
5 votes
1 answer
1k views

Lint check "RemoveWorkManagerInitializer" fails, how to fix that?

My App class implements Configuration.Provider.getWorkManagerConfiguration, and regarding this article: https://developer.android.com/topic/libraries/architecture/workmanager/advanced/custom-...
Arkaha's user avatar
  • 1,612
5 votes
1 answer
3k views

Android Delete a worker from WorkManager queue or change state from FAILED to CANCELLED

Component used: WorkManager Version used: 2.3.4 Devices/Android versions reproduced on: Any Hi There - I want to delete a worker from workmanager queue even if it has completed or is running. I ...
D Singh's user avatar
  • 51
5 votes
0 answers
2k views

Android Studio: worker class for upload data to firebase

I am looking for a solution for uploading data to Firebase without having the user wait for the data to upload, so that the user can use the app in offline mode. Let's suppose that the app is about ...
Aliton Oliveira's user avatar
5 votes
0 answers
820 views

Android WorkManager is not responding to system time

Basically, I am trying to use WorkManager to start job at specific time in the future (e.g. 24h or 1 week from now). I understand that WorkManager does not guarantee specific time, but that it will be ...
Danijel's user avatar
  • 131
5 votes
1 answer
612 views

Support library version of WorkManager

Is there a support library version of WorkManager. In the release notes of WorkManager, there is a pre androidx version 1.0.1 available. But on adding the same as dependency implementation "android....
Tulika's user avatar
  • 645
5 votes
0 answers
2k views

Open Battery Optimization activity of specific app in device settings

I am using WorkManager library to schedule a background task, and to prevent the app from sleeping the battery optimization section is opened from the app for the users to manually disable ...
Noyal Jose's user avatar
5 votes
1 answer
6k views

Could not resolve com.google.guava:listenablefuture:{strictly 1.0} when testing WorkManager

I have an app that uses WorkManager for some scheduled tasks, and I'm testing it with the aid of a bunch of different frameworks. It seems relevant to this issue that I'm using robolectric and of ...
sophia's user avatar
  • 405
5 votes
0 answers
705 views

Can a FirebaseMessagingService be made a lifecyleowner?

A Service can extend LifecycleService which implements LifecycleOwner. How to go about making a FirebaseMessagingService be one. Even if it just implements LifecycleOwner, what would it return on the ...
Neo's user avatar
  • 1,181
5 votes
0 answers
3k views

How to access room DB in Work Manager to Sync Periodically?

I want to sync Room database periodically. I am using work manager to do it. I have created a periodic work request and I want to send a table with setInputData(TABLE HERE..). I want to know if I am I ...
Tushar Pingale's user avatar
5 votes
1 answer
2k views

WorkManager is cancelled after phone goes into doze mode on Samsung Galaxy phones

I am trying to run background service with WorkManager. I started WorkManager when app goes to background. And I also started background service whenever WorkManger is running. I can see my app ...
Young's user avatar
  • 51
5 votes
1 answer
2k views

Data cannot occupy more than 10240KB when serialized [android-workmanager]

After I run the following code: outputData = Data.Builder().putString("result", data).putInt("code", 100).build() I get this error: java.lang.IllegalStateException: Data cannot occupy more ...
yu wenque's user avatar
4 votes
0 answers
710 views

Workmanager with Kotlin Multiplatform Mobile

I want to call a method in from CommonMain periodically even when the app is in background. I wanted to start to implement it for Android, so I tried with Workmanager. But I realised that I cannot ...
basti394's user avatar
  • 353
4 votes
0 answers
257 views

Expedited jobs cannot be delayed - How to have a delayed started long running task when app is in background, for API 31?

Before API 31, we are using the following guideline, to implement a delayed started long running task, when user "quit" the app. https://developer.android.com/topic/libraries/architecture/...
Cheok Yan Cheng's user avatar
4 votes
0 answers
252 views

WorkManager - Unable to create Worker with custom argument and Hilt

I am trying to make a Worker with custom constructor arguments. Moreover, the Worker is in a different module and not in the app module. Here is my code: Module - order @HiltWorker class ...
Chandra Sekhar's user avatar
4 votes
0 answers
848 views

Downloading multiple files using WorkManager

Our app needs to download files with the following requirements: User can dynamically add or cancel downloads Files are downloaded one at a time Sometimes in background we need to schedule several ...
algrid's user avatar
  • 5,779
4 votes
1 answer
5k views

WorkManager is not initialized properly

I am using work manager in my application and with the latest library implementation 'androidx.work:work-runtime:2.7.1' In the manifest <provider android:name="androidx.startup....
WISHY's user avatar
  • 11.6k
4 votes
1 answer
3k views

android studio workmanager once a day at a specific hour

I'm trying to make an app that make a web request once a day and then push a notification with work manager. Now, I managed to do everything except the part with the scheduling of the workmanager. I ...
neta cohen's user avatar
4 votes
0 answers
772 views

Notification is not showing with workmanager foregroundInfo

I wanted to create a notification with heads up feature . Basically it is a alarm feature. And I wanted to show with notification using foreground. Now workmanager has the feature to run in foreground ...
Jeevan Rupacha's user avatar
4 votes
1 answer
570 views

Android WorkRequest NetworkType constraint can't tell between VPN with internet and without

I have a WorkRequest that I want to run when the device has an internet connection. Constraints seem to be the way to do this - I can define a NetworkType constraint like so: val constraints = ...
Liam's user avatar
  • 41
4 votes
0 answers
782 views

Forground service and workmanager notification continues to show even after stopping the workmanager

This is a simple example of workmanager as a forground service. The problem is that forground notification is showing even after the workmanager is stopped. I feel like the problem is related to ...
Mehranjp73's user avatar
4 votes
0 answers
2k views

PeriodicWorkRequest not working periodically

I have built a simple PeriodicWorkRequest following Android's WorkManager docs here. I basically need a worker that runs every 15 minutes. However my worker is only running once and never again. Here ...
Faruk Yazici's user avatar
  • 2,384
4 votes
0 answers
156 views

How to figure out why a task failed in Jetpack WorkManager?

I have integrated Jetpack WorkManager into my application and for some reason the Worker is failing because of an exception. When this happens locally in my development environment, that fine. I can ...
Peter Fortuin's user avatar
4 votes
1 answer
3k views

Direct boot mode enabled app is crashing after implementing WorkManager?

Due to background service limitations, we implemented our app with the help of WorkManager and replaced the AsyncTask. The app supports Direct-boot-mode, so we are storing our required ...
PPB's user avatar
  • 161
4 votes
0 answers
44 views

What happens to recurring work when the device is off?

While using WorkManager, I could not find the documentation for an expected behavior: Suppose I scheduled an hourly task, and the device was shutdown from 16:00 to 08:00, then, after the device ...
atotalnoob's user avatar
4 votes
2 answers
2k views

WorkManager with network contraints not running on android 9 emulator

WorkManager enqueued a network restricted work, only enqueued without running on android 9 emulator 8532-8549 D/WM-PackageManagerHelper: androidx.work.impl.background.systemalarm.RescheduleReceiver ...
leon's user avatar
  • 560

1
2 3 4 5
12