Status Update
Comments
ra...@google.com <ra...@google.com> #2
After the app process crashes more than a few times, ActivityManager designates that the app as "bad". JobScheduler tries to bind to WorkManager's JobService via ActivityManager to start a job, and times out because ActivityManager considers this app "bad" the will not allow binds to the JobService.
At this point JobScheduler drops the job (a bug) and hence the Worker is still ENQUEUED.
At some point in the future (after a subsequent process restart / more Workers being enqueued) this Worker will eventually execute because a new job is created by WorkManager (because WorkManager discovers a Worker does not have a backing job).
I am going to file a bug with JobScheduler to better handle this edge case. However, this is not something WorkManager can work around. Also, your work is not blocked indefinitely. It will eventually transition to a RUNNING state.
At this point JobScheduler drops the job (a bug) and hence the Worker is still ENQUEUED.
At some point in the future (after a subsequent process restart / more Workers being enqueued) this Worker will eventually execute because a new job is created by WorkManager (because WorkManager discovers a Worker does not have a backing job).
I am going to file a bug with JobScheduler to better handle this edge case. However, this is not something WorkManager can work around. Also, your work is not blocked indefinitely. It will eventually transition to a RUNNING state.
sa...@gmail.com <sa...@gmail.com> #3
Hello Thanks for the response.
I have checked the other issues for work manager.I think this issue is duplicate of 110745313 also.
https://issuetracker.google.com/110745313
I have checked the other issues for work manager.I think this issue is duplicate of 110745313 also.
Description
Version used: 1.0.0
OS Version : pie (9.0)
Devices/Android versions reproduced on: HUAWEI BKL-L09
//snippet
val constraints = Constraints
.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
//setUpdateCurrent - needed to schedule latest
val offlinePunchWorkRequest = OneTimeWorkRequest
.Builder(SavePunchWorker::class.java)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, 1, TimeUnit.MINUTES)
.setConstraints(constraints)
.setInputData(createInputData(currentDateData))
.addTag("offlinePunch")
.build()
WorkManager
.getInstance()
.beginUniqueWork(currentDateData, ExistingWorkPolicy.APPEND, offlinePunchWorkRequest)
.enqueue()
finish()
I have scheduled the work request when network is not available,
after killing the application when network comes Job getting scheduled and getting this error in the Logcat
2019-03-08 13:10:03.945 1270-1270/? D/JobScheduler: Error executing JobStatus{cad0ba0 #u0a333/2
2019-03-08 13:10:21.945 1270-1270/? W/JobServiceContext: Time-out while trying to bind cad0ba0 #u0a333/2