Status Update
Comments
rh...@google.com <rh...@google.com>
rh...@google.com <rh...@google.com> #3
Artifact used androidx.work:work-runtime:2.3.1
Version used:2.3.1
Theme used:
Devices/Android versions reproduced on:
Pixel devices,One Plus devices / 10.0
Samsung, Realme, Oppo/ 9.0
Motorola / 8.0
- Relevant code to trigger the issue.
WorkManager workManagerInstance = WorkManager.getInstance(context);
Data input = new Data.Builder().putString("xxx", xxx).build();
Constraints constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED).build();
mGetShowRequest = new OneTimeWorkRequest.Builder(ShowParserWork.class)
.setConstraints(constraints).setInputData(input)
.addTag(TAG_WORKER_NAME)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, 30, TimeUnit.SECONDS).build();
workManagerInstance.enqueueUniqueWork(TAG_WORKER_NAME,
ExistingWorkPolicy.KEEP,mGetShowRequest);
Stacktrace:-
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 101 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal + 199(SystemJobScheduler.java:199)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule + 127(SystemJobScheduler.java:127)
at androidx.work.impl.Schedulers.schedule + 92(Schedulers.java:92)
at androidx.work.impl.WorkerWrapper.onWorkFinished + 369(WorkerWrapper.java:369)
at androidx.work.impl.WorkerWrapper$2.run + 318(WorkerWrapper.java:318)
at androidx.work.impl.utils.SerialExecutor$Task.run + 91(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1167(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 641(ThreadPoolExecutor.java:641)
at java.lang.Thread.run + 919(Thread.java:919)
Caused by java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.os.Parcel.createException + 2079(Parcel.java:2079)
at android.os.Parcel.readException + 2039(Parcel.java:2039)
at android.os.Parcel.readException + 1987(Parcel.java:1987)
at android.app.job.IJobScheduler$Stub$Proxy.schedule + 308(IJobScheduler.java:308)
at android.app.JobSchedulerImpl.schedule + 43(JobSchedulerImpl.java:43)
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal + 181(SystemJobScheduler.java:181)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule + 127(SystemJobScheduler.java:127)
at androidx.work.impl.Schedulers.schedule + 92(Schedulers.java:92)
at androidx.work.impl.WorkerWrapper.onWorkFinished + 369(WorkerWrapper.java:369)
at androidx.work.impl.WorkerWrapper$2.run + 318(WorkerWrapper.java:318)
at androidx.work.impl.utils.SerialExecutor$Task.run + 91(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1167(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 641(ThreadPoolExecutor.java:641)
Caused by android.os.RemoteException: Remote stack trace:
at com.android.server.job.JobSchedulerService.scheduleAsPackage(JobSchedulerService.java:1038)
at com.android.server.job.JobSchedulerService$JobSchedulerStub.schedule(JobSchedulerService.java:2740)
at android.app.job.IJobScheduler$Stub.onTransact(IJobScheduler.java:153)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
This issue has resurfaced only on our production builds, with multiple instances of crashes. Can you let us know a fix for this issue? Thanks
ca...@gmail.com <ca...@gmail.com> #4
We fixed a bug recently, where there is a mismatch between WorkManager
s tracking of jobs in JobScheduler
and the actual state of the jobs
. This happens in very rare cases, and I think that's what is going on in your case.
This change (WorkManager
2.3.2 very soon.
If you cannot wait, you can use a snapshot build that should be identical to the eventual release.
Here is the gradle snippet you will need:
repositories {
google()
maven { url 'https://ci.android.com/builds/submitted/6195753/androidx_snapshot/latest/repository/' }
}
dependencies {
implementation "androidx.work:work-runtime:2.4.0-SNAPSHOT"
}
One other thing you might need to do is to get rid of stale jobs. It is as simple as calling JobScheduler.cancelAllJobs()
before WorkManager is initialized. You can do it inside Application.onCreate()
in your Application subclass.
rh...@google.com <rh...@google.com> #5
sa...@gmail.com <sa...@gmail.com> #6
Failed to resolve: androidx.work:work-runtime:2.4.0-SNAPSHOT
<a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Affected Modules: <a href="openFile:D:/ Android App/app/build.gradle">app</a>
In my Application class, we have added WorkManager.getInstance(this).cancelAllWork();.Also, should I use the same work manager instance from my application class for all my work requests?
al...@gmail.com <al...@gmail.com> #7
Coming from stackoverflow here.
The build you mentioned doesn't seem to exist, and when I use the latest build (
I get some very weird missing library errors.
pd...@gmail.com <pd...@gmail.com> #8
My apologies for the delay. Try using this. This is from our dev branch.
repositories {
google()
maven { url 'https://ci.android.com/builds/submitted/6215972/androidx_snapshot/latest/repository/' }
}
dependencies {
implementation "androidx.work:work-runtime:2.4.0-SNAPSHOT"
}
am...@gmail.com <am...@gmail.com> #9
bs...@gmail.com <bs...@gmail.com> #10
My apologies, it looks like the artifacts were not generated for that build. I have verified that this one works:
repositories {
google()
maven { url '
dependencies { implementation "androidx.work:work-runtime:2.4.0-SNAPSHOT" }
re...@gmail.com <re...@gmail.com> #11
My apologies, it looks like the artifacts were not generated for that build. I have verified that this one works:
repositories {
google()
maven { url 'https://ci.android.com/builds/submitted/6217200/androidx_snapshot/latest/repository/' }
}
dependencies {
implementation "androidx.work:work-runtime:2.4.0-SNAPSHOT"
}
ha...@gmail.com <ha...@gmail.com> #12
se...@gmail.com <se...@gmail.com> #13
Logs:
androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal + 199 (SystemJobScheduler.java:199)
androidx.work.impl.background.systemjob.SystemJobScheduler.schedule + 127 (SystemJobScheduler.java:127)
androidx.work.impl.Schedulers.schedule + 92 (Schedulers.java:92)
androidx.work.impl.utils.ForceStopRunnable.run + 98 (ForceStopRunnable.java:98)
androidx.work.impl.utils.SerialExecutor$Task.run + 91 (SerialExecutor.java:91)
java.util.concurrent.ThreadPoolExecutor.runWorker + 1133 (ThreadPoolExecutor.java:1133)
java.util.concurrent.ThreadPoolExecutor$Worker.run + 607 (ThreadPoolExecutor.java:607)
java.lang.Thread.run + 761 (Thread.java:761)
Caused by java.lang.IllegalStateException
Apps may not schedule more than 100 distinct jobs
android.os.Parcel.readException + 1691 (Parcel.java:1691)
android.os.Parcel.readException + 1636 (Parcel.java:1636)
android.app.job.IJobScheduler$Stub$Proxy.schedule + 158 (IJobScheduler.java:158)
android.app.JobSchedulerImpl.schedule + 42 (JobSchedulerImpl.java:42)
androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal + 181 (SystemJobScheduler.java:181)
androidx.work.impl.background.systemjob.SystemJobScheduler.schedule + 127 (SystemJobScheduler.java:127)
androidx.work.impl.Schedulers.schedule + 92 (Schedulers.java:92)
androidx.work.impl.utils.ForceStopRunnable.run + 98 (ForceStopRunnable.java:98)
androidx.work.impl.utils.SerialExecutor$Task.run + 91 (SerialExecutor.java:91)
java.util.concurrent.ThreadPoolExecutor.runWorker + 1133 (ThreadPoolExecutor.java:1133)
java.util.concurrent.ThreadPoolExecutor$Worker.run + 607 (ThreadPoolExecutor.java:607)
java.lang.Thread.run + 761 (Thread.java:761)
As you can see this log line :-
androidx.work.impl.utils.ForceStopRunnable.run + 98 (ForceStopRunnable.java:98)
This is happening during force stop or application got killed
Will this fix cover this scenario as well??
ch...@gmail.com <ch...@gmail.com> #14
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 101 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:199)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:127)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:92)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:98)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
IMPORTANT INFO
95% of affected devices are OPPO, Xiaomi and Redmi. Only one Huawey and one Samsung afected.
100% of affected devices are Android 7
100% of affected devices had less than 900MB disk free.
Our app allows the user to download content in background using WorkManager. A user can easily launch several hundred of very small downloads (10~100K) at the same time. The downloaded content can easily reach 300~600MB in total.
ca...@gmail.com <ca...@gmail.com> #15
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 3 WorkManager jobs in JobScheduler; we have 7 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:199)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:127)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:92)
at androidx.work.impl.WorkManagerImpl.rescheduleEligibleWork(WorkManagerImpl.java:631)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:90)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.os.Parcel.readException(Parcel.java:2024)
at android.os.Parcel.readException(Parcel.java:1962)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:180)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:44)
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:181)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:127)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:92)
at androidx.work.impl.WorkManagerImpl.rescheduleEligibleWork(WorkManagerImpl.java:631)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:90)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
I'm on WorkManager 2.3.4
Can you please provide a resolution for this?
na...@gmail.com <na...@gmail.com> #16
Re:
Your app is probably using JobScheduler
directly, besides WorkManager
. That is when this happens.
ba...@gmail.com <ba...@gmail.com> #17
"Fatal Exception: java.lang.IllegalStateException
JobScheduler 100 job limit exceeded. We count 0 WorkManager jobs in JobScheduler; we have 6 tracked jobs in our DB; our Configuration limit is 20." [WorkManager v.2.3.3].
[Your app is probably using JobScheduler directly...]
I found in merged manifest that AppMeasurementJobService and AnalyticsJobService (play-services-analytics library) use "android.permission.BIND_JOB_SERVICE". Is it means that analytics use JobScheduler directly and could produce such crashes?
Regards, Denys.
sh...@gmail.com <sh...@gmail.com> #18
Yes, AppMeasurementJobService
would be an example.
ma...@googlemail.com <ma...@googlemail.com> #19
Hi,
I am using the version 2.3.4 of the work manager library and I am still having the same problem.
I didn't do JobScheduler.cancelAllJobs() before WorkManager is initialized. You can do it inside Application.onCreate() in your Application subclass.
because we are using a third party library that is scheduling jobs and we don't really know how could affect the behaviour of the app if we cancel everything.
Is there anyway to get the only stale jobs that can be cancelled?
Regards!
la...@gmail.com <la...@gmail.com> #20
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 99 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:204)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:132)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:108)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:176)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
pf...@gmail.com <pf...@gmail.com> #21
You have another JobService
in your application which is scheduling too many jobs.
The exception from WorkManager
clearly states that we only scheduled 20
jobs.
sh...@gmail.com <sh...@gmail.com> #22
st...@gmail.com <st...@gmail.com> #23
* Devices: Pixel 2 and Pixel 2XL only (!)
Attached logs below for your reference. Please help us in resolving this.
As it was said before, I can't cancel all the jobs in my application class as I am not sure of consequences.
ch...@gmail.com <ch...@gmail.com> #24
Re: #23.
The error is very similar. You have another job service running & another part of the application is scheduling jobs directly using JobScheduler's APIs.
There are 30 jobs being tracked, and you have 48 jobs attributed to WorkManager
based on the error message.
Someone else is scheduling 52+ jobs.
iv...@gmail.com <iv...@gmail.com> #25
Have you guys solved it? I can see this issue even on relatively new versions of WorkManager
di...@gmail.com <di...@gmail.com> #26
That is because, the bug is in another library and not WorkManager. Just because you see it does not mean WorkManager caused it.
ba...@gmail.com <ba...@gmail.com> #27
Also, how can you be sure it's not WorkManager, if multiple developers here reported about it?
Which library do you think of that you say that it's from it?
Which libraries do you know that cause this issue?
ol...@gmail.com <ol...@gmail.com> #28
Why can't you at least show the stack trace of which function tried to create a new task? Or better: the place of each of the tasks that were created?
How can we do that if its not our code scheduling work with JobScheduler ?
Also, how can you be sure it's not WorkManager, if multiple developers here reported about it?
The error message makes it very clear how many jobs WorkManager actually knows about.
In the attached screenshot, WorkManager
s configuration limit is 50, and there are 48 known jobs. The app however is exceeding scheduling limits.
So some jobs are not managed by WorkManager
.
sk...@gmail.com <sk...@gmail.com> #29
Alternatively, you could have a listener that we could have, so that each time some scheduling is added, we could write it into some log (or Firebase Crashlytics).
Do you have such a thing? This way, I could add a listener whenever a task is added, logging each time a task is created, and if the app reaches 40 or some other large number, I could send a (non-fatal) crash report to Crashlytics that includes information of all of them.
Again, how can you know which libraries cause it? And which libraries do it? How do you even know that it's libraries? Could it even be Google's libraries?
I've recently noticed a very similar issue on the app I have to work on, and I've noticed it occurs (for the past 90 days, at least) only on Xiaomi and Huawei devices.
Couldn't it be that WorkManager is incompatible with the terrible behavior that such OEMs have, which is the reason for these:
?
99...@gmail.com <99...@gmail.com> #30
@28 You can always access the stack trace. And, when there is about to be a crash, you can query which tasks are pending and print all the information about them.
You could do that too, if you were really curious. And if you find bugs in other Google libraries, please file bugs.
ja...@gmail.com <ja...@gmail.com> #31
et...@gmail.com <et...@gmail.com> #32
Hi,
This issue is marked as fixed but to me it appears that some of the comments are NOT clearly addressed. We are also facing this issue using v2.5.0 and the stack trace is very similar to the #20:
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 101 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:204)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:132)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:108)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:176)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
It explicitly says that 101 jobs belongs to the WorkManager. This rules out the possibility that the jobs may be scheduled by another library that directly use JobScheduler APIs. In fact, I created a sample project to test this and verified that when JobScheduler APIs are used, the number in the stack trace becomes 0 as jobs are not scheduled by WorkManager.
From what I could gather after reading the source code where this exception occurs, it is impossible to create a scenario that would result in this exception using WorkManager APIs since the stack trace says the configuration limit is 20 and it should not be possible for WorkManager to schedule more than 20 jobs. (see: Schedulers#schedule, eligibleWorkSpecsForLimitedSlots)
ms...@gmail.com <ms...@gmail.com> #33
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 101 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
This means that you have only scheduled 20 jobs that WorkManager
is aware of. There is another JobService
being used in the app (I would look at your merged app-manifest) that is the offender here.
av...@gmail.com <av...@gmail.com> #34
This means that you have only scheduled 20 jobs that WorkManager is aware of
I am not sure if this inference is correct for the stack trace I've shared.
Looking at the source code for the SystemJobScheduler#getPendingJobs
where the number 101 in the stack trace comes from, I can see that it is the number of jobs that JobScheduler
is aware of and uses SystemJobService
as the service component. SystemJobService
is the service used by WorkManager to schedule jobs. Even if the JobScheduler
is used directly by another library as you pointed out, it would not use the SystemJobService
and therefore would not show up or add up to the number we see in the stack trace.
bb...@gmail.com <bb...@gmail.com> #35
No, we tabulate both. Jobs we own (like you suggested) and jobs scheduled overall.
Like I said, this is not something WorkManager can help with. You need to figure out the actual component to blame. Even something as simple as adb shell dumpsys jobscheduler
will tell you what's going on.
of...@gmail.com <of...@gmail.com> #36
No, we tabulate both. Jobs we own (like you suggested) and jobs scheduled overall.
Again, I would have to disagree. Below is the related part of the source code:
@Nullable
private static List<JobInfo> getPendingJobs(
@NonNull Context context,
@NonNull JobScheduler jobScheduler) {
List<JobInfo> pendingJobs = null;
try {
// Note: despite what the word "pending" and the associated Javadoc might imply, this is
// actually a list of all unfinished jobs that JobScheduler knows about for the current
// process.
pendingJobs = jobScheduler.getAllPendingJobs();
} catch (Throwable exception) {
// OEM implementation bugs in JobScheduler cause the app to crash. Avoid crashing.
Logger.get().error(TAG, "getAllPendingJobs() is not reliable on this device.",
exception);
}
if (pendingJobs == null) {
return null;
}
// Filter jobs that belong to WorkManager.
List<JobInfo> filtered = new ArrayList<>(pendingJobs.size());
ComponentName jobServiceComponent = new ComponentName(context, SystemJobService.class);
for (JobInfo jobInfo : pendingJobs) {
if (jobServiceComponent.equals(jobInfo.getService())) {
filtered.add(jobInfo);
}
}
return filtered;
}
The first number does NOT contain all the scheduled jobs as there is an explicit filtering for counting only the jobs that belong to WorkManager. Wouldn't this mean that 101 jobs in the stack trace I've shared were actually scheduled by the WorkManager at some point? Otherwise it would've been filtered out in the last part above.
I think what you suggest is a separate scenario where bug with a similar stack trace could be encountered but in that case I would expect a different stack trace from what I've shared. What you suggest would look more like the stack trace in the
ma...@gmail.com <ma...@gmail.com> #37
WorkManager 2.5.x is over 2 years old at this point. Please upgrade to the latest stable version and then file a new bug report.
In the latest alpha version, you can go further and use a SchedulingExceptionHandler
(an @Restricted
API) to get better signals on where the underlying problem might be.
Also, 2.5.x is not supported on Android S+ devices at all. You will need a minimum of 2.7.1
.
sh...@gmail.com <sh...@gmail.com> #38
```Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 12 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:218)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:133)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:108)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:226)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:110)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)```
My version of "androidx.work:work-runtime-ktx" is 2.7.1. Most of the devices got this crash is Xiaomi 11 Lite.
I have check the source code, no implementation call `Context.getSystemService(Context.JOB_SCHEDULER_SERVICE)` to get the JobScheduler. I just see the implementation of WorkManager. But the report said that only 12 WorkManager jobs were found. So where are the remaining come from?
je...@gmail.com <je...@gmail.com> #39
Caused by java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.os.Parcel.createException(Parcel.java:2079)
at android.os.Parcel.readException(Parcel.java:2039)
at android.os.Parcel.readException(Parcel.java:1987)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:308)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:43)
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:191)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:137)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:108)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:255)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:134)
at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Any update on fixe?
da...@gmail.com <da...@gmail.com> #40
You are very likely using another library that is scheduling jobs directly. I would look at the merged AndroidManifest.xml
to find the other JobService instance.
ja...@gmail.com <ja...@gmail.com> #41
We are using androidx.work:work-runtime:2.9.0
and getting the same exception in Firebase Crashlytics.
Fatal Exception: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 100 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:223)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:140)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:133)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:266)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:135)
at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.os.Parcel.createException(Parcel.java:2096)
at android.os.Parcel.readException(Parcel.java:2056)
at android.os.Parcel.readException(Parcel.java:2004)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:324)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:43)
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:194)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:140)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:133)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:266)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:135)
at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
More information:
- All of the places we enqueue work are using the
enqueueUnique
version, with theKEEP
flag - We do not bind directly to the
JOB_SCHEDULER_SERVICE
anywhere in our code. - I checked the merged manifest, here are the list of services to bind to the
JOB_SCHEDULER_SERVICE
, they are all part of Firebase:com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService
,com.google.android.gms.measurement.AppMeasurementJobService
,com.google.android.gms.analytics.AnalyticsJobService
,androidx.work.impl.background.systemjob.SystemJobService
Any ideas?
an...@gmail.com <an...@gmail.com> #42
I am also seeing this error state with WorkManager 2.8.1 and 2.9.0, possibly arising in connection with crashes in the app using WorkManager.
2024-05-29 18:52:43.792824737 +0000 10041 23649 23685 E AndroidRuntime: java.lang.IllegalStateException: JobScheduler 100 job limit exceeded. We count 151 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20.
2024-05-29 18:52:43.792824737 +0000 10041 23649 23685 E AndroidRuntime: at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:220)
There is no direct JobScheduler API use at all in the codebase, only WorkManager.
1s...@gmail.com <1s...@gmail.com> #43
Are you seeing reference to other job services when you run adb shell dumpsys jobscheduler
?
The error message is more confusing than it needs to be. The number of WorkRequests that WorkManager
is aware of is 20. Even though the error message uses the name WorkManager jobs
, its actually referring to the total number of jobs that JobScheduler
knows about.
There seem to be other jobs that a dependency might be scheduling.
cj...@gmail.com <cj...@gmail.com> #44
In the incident quoted at #42, there are no jobs scheduled for the app other than WorkManager jobs.
We've gone so far as to decompile and audit the deployed APK for any Job Scheduler use that might have been brought in "silently" via libraries. I can confirm that the only scheduled job access by this app is via WorkManager. (And WM's androidx.work.impl.background.systemjob.SystemJobService
is the only job service declared in the APK, also verified via direct inspection with aapt
.)
ja...@gmail.com <ja...@gmail.com> #45
That is extremely strange. Can you try and turn on verbose logging using the instructions in:
Could you please Log.DEBUG
as your log level so we get more information. Also, can you consistently reproduce this?
dr...@gmail.com <dr...@gmail.com> #46
da...@gmail.com <da...@gmail.com> #47
t....@gmail.com <t....@gmail.com> #48
We are also seeing this error in the crashlytics.
#47, How did you resolve the issue, are you doing pruneWork
in Application.onCreate
? Were you able to replicate the issue?
ba...@gmail.com <ba...@gmail.com> #49
For posterity: If you are seeing this on a new version of WorkManager - some other component in the app is scheduling jobs and that is what is causing this.
le...@gmail.com <le...@gmail.com> #50
Thank you for reverting back.
Yes, we are using the latest version of WM, that is 2.9.0. The error mentions the count of WM jobs scheduled.
"JobScheduler 100 job limit exceeded. We count 151 WorkManager jobs in JobScheduler; we have 20 tracked jobs in our DB; our Configuration limit is 20."
And internally observed, that WM jobs are filtered from all pending jobs:
// Filter jobs that belong to WorkManager.
List<JobInfo> filtered = new ArrayList<>(pendingJobs.size());
ComponentName jobServiceComponent = new ComponentName(context, SystemJobService.class);
for (JobInfo jobInfo : pendingJobs) {
if (jobServiceComponent.equals(jobInfo.getService())) {
filtered.add(jobInfo);
}
}
Please let me know if I am missing something here.
al...@gmail.com <al...@gmail.com> #51
si...@gmail.com <si...@gmail.com> #52
mi...@gmail.com <mi...@gmail.com> #53
ni...@gmail.com <ni...@gmail.com> #54
This was such a useful feature that it's removal makes the phone feel like an inconvenience in this respect.
ur...@gmail.com <ur...@gmail.com> #55
What is wrong with you people?
kl...@gmail.com <kl...@gmail.com> #56
aa...@gmail.com <aa...@gmail.com> #57
to...@gmail.com <to...@gmail.com> #58
gr...@gmail.com <gr...@gmail.com> #59
st...@gmail.com <st...@gmail.com> #60
Because of the removal of this feature, I like Android 13 better. Most other things in the update I won't use but this feature I used everyday.
ri...@richard-stevens.com <ri...@richard-stevens.com> #61
ai...@gmail.com <ai...@gmail.com> #62
an...@gmail.com <an...@gmail.com> #63
lo...@gmail.com <lo...@gmail.com> #64
rb...@gmail.com <rb...@gmail.com> #65
ja...@gmail.com <ja...@gmail.com> #66
kn...@gmail.com <kn...@gmail.com> #67
kn...@gmail.com <kn...@gmail.com> #68
ja...@gmail.com <ja...@gmail.com> #69
I could easily scan apps on my desktop, searching for games in this spot, reminders in other spots, ignore the BlackBerry dot, etc.
When apps have more than one notice, I could select the proper one from the dot: this morning's pill reminder or last night's.
Demoting the dots was a massive step backwards for me and the others on this thread. Please return them to us.
gr...@gmail.com <gr...@gmail.com> #70
It was an exceptionally useful feature - allowed me to keep an eye on things without having to open the respective apps and check through them - I used it many times a day.
I have seen no improvements that directly affect me in Android 14, though I'm sure there are some useful things hidden away in there, and it comes with this huge disadvantage - what is the point in Android 14 if it's only obvious change is to make life worse for users?
Notification dots are now meaningless. I have a bunch of apps with dots on them that I have no way to remove, nothing showing in the slide down menu, nothing showing in the app - Twitter/X for example - so have no idea if there is something I need to react to when I glance at the screen.
Long press on the icon is now also a total waste of time - doesn't ever give you anything you would want to interact with.
Does anyone know if it is safe/feasible to return to Android 13?
mr...@gmail.com <mr...@gmail.com> #71
mr...@gmail.com <mr...@gmail.com> #72
mi...@gmail.com <mi...@gmail.com> #73
gs...@gmail.com <gs...@gmail.com> #74
mi...@gmail.com <mi...@gmail.com> #75
is...@gmail.com <is...@gmail.com> #76
pi...@gmail.com <pi...@gmail.com> #77
cl...@gmail.com <cl...@gmail.com> #78
ke...@gmail.com <ke...@gmail.com> #79
ye...@gmail.com <ye...@gmail.com> #80
The only thing I might disagree with is that it's the dumbest thing Google has ever done, because Google's graveyard is filled with good shit, albeit buried. The current (non) notification dots are not only less useful than before, they're worse than useless.
si...@gmail.com <si...@gmail.com> #81
mo...@gmail.com <mo...@gmail.com> #82
dy...@gmail.com <dy...@gmail.com> #83
an...@gmail.com <an...@gmail.com> #84
je...@gmail.com <je...@gmail.com> #85 Restricted+
ad...@gmail.com <ad...@gmail.com> #86
ko...@gmail.com <ko...@gmail.com> #87
cl...@gmail.com <cl...@gmail.com> #88
This is the truly terrible change. I'm seriously thinking about dumping Android after 10 years because of this stupidity.
er...@gmail.com <er...@gmail.com> #89
ro...@hotmail.com <ro...@hotmail.com> #90
Please return this feature to it's previous setting - or at least allow the user to set it to it's previous setting.
Also a quantity number in the dot would be a great feature - I see you have this on the "+1' setting on the top of the page! Very handy!
se...@gmail.com <se...@gmail.com> #91
pa...@gmail.com <pa...@gmail.com> #92
pe...@gmail.com <pe...@gmail.com> #93
ma...@gmail.com <ma...@gmail.com> #94
tp...@gmail.com <tp...@gmail.com> #95
na...@gmail.com <na...@gmail.com> #96
mi...@gmail.com <mi...@gmail.com> #97
ga...@gmail.com <ga...@gmail.com> #98
pc...@gmail.com <pc...@gmail.com> #99
fr...@gmail.com <fr...@gmail.com> #100
mj...@gmail.com <mj...@gmail.com> #101
ho...@gmail.com <ho...@gmail.com> #102
le...@alleys.me.uk <le...@alleys.me.uk> #103
he...@gmail.com <he...@gmail.com> #104
st...@gmail.com <st...@gmail.com> #105
jo...@blakely.org <jo...@blakely.org> #106
rt...@gmail.com <rt...@gmail.com> #107
This is a massive regression. Please restore this feature.
su...@gmail.com <su...@gmail.com> #108
ms...@gmail.com <ms...@gmail.com> #109
da...@gmail.com <da...@gmail.com> #110
te...@gmail.com <te...@gmail.com> #111
I expect this change to be rollbacked for the next update.
go...@gmail.com <go...@gmail.com> #112
mb...@gmail.com <mb...@gmail.com> #113
me...@gmail.com <me...@gmail.com> #114
jh...@gmail.com <jh...@gmail.com> #115
ni...@gmail.com <ni...@gmail.com> #116
jo...@gmail.com <jo...@gmail.com> #117
This is still working on other launcher apps running on Android 14 (Action Launcher, Lawnchair, etc.). Can we confirm that it is really "intended behavior" to make it stop working on the official Google Pixel launcher app?
Even the documentation for developers at
https://developer.android.com/develop/ui/views/notifications/badges
still states the following:
"Starting with Android 8.0 (API level 26), notification badges—also known as notification dots—appear on a launcher icon when the associated app has an active notification. Users can touch & hold the app icon to reveal the notifications, along with any app shortcuts, as shown in figure 1."
:)
ja...@gmail.com <ja...@gmail.com> #118
dp...@gmail.com <dp...@gmail.com> #119
tw...@gmail.com <tw...@gmail.com> #120
vi...@gmail.com <vi...@gmail.com> #121
ja...@gmail.com <ja...@gmail.com> #122
sh...@gmail.com <sh...@gmail.com> #123
rj...@gmail.com <rj...@gmail.com> #124
Please reinstate this feature and bring back the lost functionality. Google has already hobbled Android enough by removing the features that made it really useful such as Android Auto on the phone face and having personal reminders show up on the home screen.
Based on the responses here, you have to know that your customers really want the feature. And all it takes is a quick search to hear similar comments all over the place. But I promise you won't find a single one that says "whew!!! So glad I can't see details of my notifications anymore!"
The code is already written for it - just copy/paste it back in from 13.
mn...@gmail.com <mn...@gmail.com> #125
se...@gmail.com <se...@gmail.com> #126
Put it back in please and thank you!
pa...@gmail.com <pa...@gmail.com> #127
The removal of this feature is very disappointing. It's the best way to access notifications from a given app. For those of us that don't care to have a clear notification bar all the time, it was a life saver. Pretty please, bring it back as an option at least 🙏🙏🙏
mo...@gmail.com <mo...@gmail.com> #128
ru...@gmail.com <ru...@gmail.com> #129
mr...@gmail.com <mr...@gmail.com> #130
ru...@gmail.com <ru...@gmail.com> #132
mo...@gmail.com <mo...@gmail.com> #133
ad...@gmail.com <ad...@gmail.com> #134
ml...@gmail.com <ml...@gmail.com> #135
na...@gmail.com <na...@gmail.com> #136
I've been on the nexus/pixel train since the nexus 5x and this is probably the worst thing that has happened in that time
jn...@gmail.com <jn...@gmail.com> #137
zs...@gmail.com <zs...@gmail.com> #138
25...@gmail.com <25...@gmail.com> #139
Bring it back ASAP please.
Pixel 6, Android 14
wa...@gmail.com <wa...@gmail.com> #140
je...@gmail.com <je...@gmail.com> #141
ja...@gmail.com <ja...@gmail.com> #142
be...@googlemail.com <be...@googlemail.com> #143
This was a great way to quickly dismiss unimportant notifications or quickly open important ones.
br...@ure.org.uk <br...@ure.org.uk> #144
pa...@gmail.com <pa...@gmail.com> #145
ts...@gmail.com <ts...@gmail.com> #146
ta...@gmail.com <ta...@gmail.com> #147
sc...@gmail.com <sc...@gmail.com> #148
l8...@gmail.com <l8...@gmail.com> #149
dl...@gmail.com <dl...@gmail.com> #150
he...@gmail.com <he...@gmail.com> #151
ma...@gmail.com <ma...@gmail.com> #152
to...@gmail.com <to...@gmail.com> #153
mo...@gmail.com <mo...@gmail.com> #154
g....@gmail.com <g....@gmail.com> #155
se...@gmail.com <se...@gmail.com> #156
on...@gmail.com <on...@gmail.com> #157
It's okay, everyone makes mistakes, but out this back to how it was please.
sm...@gmail.com <sm...@gmail.com> #158
ap...@gmail.com <ap...@gmail.com> #159
jd...@gmail.com <jd...@gmail.com> #160
ji...@gmail.com <ji...@gmail.com> #161
lu...@gmail.com <lu...@gmail.com> #162
em...@gmail.com <em...@gmail.com> #163
ho...@gmail.com <ho...@gmail.com> #164
is...@gmail.com <is...@gmail.com> #165
je...@gmail.com <je...@gmail.com> #166
aj...@gmail.com <aj...@gmail.com> #167
al...@gmail.com <al...@gmail.com> #168
ch...@gmail.com <ch...@gmail.com> #169
ro...@gmail.com <ro...@gmail.com> #170
ne...@gmail.com <ne...@gmail.com> #171
la...@gmail.com <la...@gmail.com> #172
gi...@gmail.com <gi...@gmail.com> #173
ja...@gmail.com <ja...@gmail.com> #174
This sucks. I'm OK with it not being a default, or even getting turned off on all phones to avoid some privacy or security issue - but let users that want it, turn it back on, please.
ja...@gmail.com <ja...@gmail.com> #175
well? Why no response to people who have taken the time to make their concerns known?
jb...@gmail.com <jb...@gmail.com> #176
st...@gmail.com <st...@gmail.com> #177
I was seriously confused when I updated and could no longer easily access a specific apps notifications like I could before.
is...@gmail.com <is...@gmail.com> #178
da...@gmail.com <da...@gmail.com> #179
fr...@gmail.com <fr...@gmail.com> #180
jc...@gmail.com <jc...@gmail.com> #181
sh...@gmail.com <sh...@gmail.com> #182
ra...@gmail.com <ra...@gmail.com> #183
ti...@gmail.com <ti...@gmail.com> #184
co...@gmail.com <co...@gmail.com> #185
jd...@gmail.com <jd...@gmail.com> #186
Reading here that this is "intended behaviour" makes as little sense as buying a new car, getting noticing it's missing a door, and having the dealership tell me that "we now sell them like that intentionally".
So please, bring this feature back.
lo...@gmail.com <lo...@gmail.com> #187
te...@gmail.com <te...@gmail.com> #188
It seems to be highly regarded by passionate users. If it had performance/battery impact, add a warning saying it will impact performance/battery, as there are warnings for multiple other features.
At the very least, please explain to your loyal users why it was removed.
si...@gmail.com <si...@gmail.com> #189
It's hard to imagine anyone that uses Android on a daily basis deciding this feature wasn't worth maintaining. Perhaps your product managers all use Apple phones?!
dc...@gmail.com <dc...@gmail.com> #190
Can we have this back please. When getting back to the phone after a days work or a busy time, it is very handy to just go to the apps you really care about and preview the notifications, one app at a time. The big list of notifications from the top drag-down is sometimes unmanageable in a hurry.
Description
(Note: It is the build when sending this report. For exact build reference, please see the attached bugreport.)
What type of Android issue is this? Other issue
What steps would let us observe this issue?
1. Long press on app icon with notification dot.
2. Notification list does not appear, only widgets and app info.
What did you expect to happen?
See list of notifications for the app as in the previous Android version.
What actually happened?
Only App info and widgets appear, not notifications.
How often has this happened?
Every time
What was the effect of this issue on your device usage, such as lost time or work?
Slight
Additional comments
This was a very useful feature and I hope that it will be brought back.
Debugging information
Google Play services
com.google.android.gms
Version 231715044 (23.17.15 (190400-534251769))
System App (Updated)
Android System WebView
com.google.android.webview
Version 567252433 (113.0.5672.24)
System App (Updated)
Network operator: T-Mobile
SIM operator: T-Mobile
Filed by Android Beta Feedback. Version (Updated): 2.34-betterbug.external_20230413_RC05 (DOGFOOD)
To learn more about our feedback process, please visit