Fixed
Status Update
Comments
su...@google.com <su...@google.com> #2
Bringing setMaxSchedulerLimit to say 49 doesn't help. Same error.
ru...@gmail.com <ru...@gmail.com> #3
If you are using work-firebase then you should not be using JobScheduler directly. Can you please send us the full bug report so we can investigate ?
an...@google.com <an...@google.com> #4
java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.os.Parcel.readException(Parcel.java:1692)
at android.os.Parcel.readException(Parcel.java:1637)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:158)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:42)
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:126)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:95)
at androidx.work.impl.Schedulers.scheduleInternal(Schedulers.java:104)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:73)
at androidx.work.impl.WorkerWrapper.setSucceededAndNotify(WorkerWrapper.java:393)
at androidx.work.impl.WorkerWrapper.handleResult(WorkerWrapper.java:255)
at androidx.work.impl.WorkerWrapper.run(WorkerWrapper.java:181)
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)
at android.os.Parcel.readException(Parcel.java:1692)
at android.os.Parcel.readException(Parcel.java:1637)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:158)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:42)
at androidx.work.impl.background.systemjob.SystemJobScheduler.scheduleInternal(SystemJobScheduler.java:126)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule(SystemJobScheduler.java:95)
at androidx.work.impl.Schedulers.scheduleInternal(Schedulers.java:104)
at androidx.work.impl.Schedulers.schedule(Schedulers.java:73)
at androidx.work.impl.WorkerWrapper.setSucceededAndNotify(WorkerWrapper.java:393)
at androidx.work.impl.WorkerWrapper.handleResult(WorkerWrapper.java:255)
at androidx.work.impl.WorkerWrapper.run(WorkerWrapper.java:181)
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)
ru...@gmail.com <ru...@gmail.com> #5
What do you mean I shouldn't use JobScheduler directly? Isn't work-firebase is just for <21 devices, otherwise JobScheduler always used?
ra...@google.com <ra...@google.com> #6
I think i was confused by your previous comment. You are right, we only use work-firebase for API < 23.
JobScheduler is used for API >= 23.
This issue should have been resolved in `alpha03` and `alpha04` (we addressed different parts of the problem). If you can reproduce this on a device, then can you do:
1. adb shell dumpsys jobscheduler for your app.
2. Reboot your device.
3. After the reboot, can you re-run adb shell dumpsys jobscheduler ?
I want to check if you see any differences in the jobs created before and after the reboot.
Thanks for your patience.
JobScheduler is used for API >= 23.
This issue should have been resolved in `alpha03` and `alpha04` (we addressed different parts of the problem). If you can reproduce this on a device, then can you do:
1. adb shell dumpsys jobscheduler for your app.
2. Reboot your device.
3. After the reboot, can you re-run adb shell dumpsys jobscheduler ?
I want to check if you see any differences in the jobs created before and after the reboot.
Thanks for your patience.
ru...@gmail.com <ru...@gmail.com> #7
Actually for step 2, the easier thing to do is to force stop your app. You don't need to fo a full reboot.
Description
Version used: 2.1.0
Devices/Android versions reproduced on: 6.0
We're getting this crash on multiple devices:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.util.ArrayMap.containsKey(java.lang.Object)' on a null object reference
at android.os.BaseBundle.containsKey + 277(BaseBundle.java:277)
at androidx.work.impl.background.systemjob.SystemJobScheduler.getPendingJobIds + 331(SystemJobScheduler.java:331)
at androidx.work.impl.background.systemjob.SystemJobScheduler.schedule + 138(SystemJobScheduler.java:138)
at androidx.work.impl.Schedulers.schedule + 93(Schedulers.java:93)
at androidx.work.impl.WorkManagerImpl.rescheduleEligibleWork + 587(WorkManagerImpl.java:587)
at androidx.work.impl.utils.ForceStopRunnable.run + 82(ForceStopRunnable.java:82)
at androidx.work.impl.utils.SerialExecutor$Task.run + 75(SerialExecutor.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1113(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 588(ThreadPoolExecutor.java:588)
at java.lang.Thread.run + 833(Thread.java:833)
For some reason, the mMap in BaseBundle is null and getPendingJobIds doesn't catch that:
for (JobInfo jobInfo : jobs) {
PersistableBundle extras = jobInfo.getExtras();
// The map inside extras can be null, so extras.containsKey can cause a NPE
if (extras != null && extras.containsKey(EXTRA_WORK_SPEC_ID)) {
if (workSpecId.equals(extras.getString(EXTRA_WORK_SPEC_ID))) {
jobIds.add(jobInfo.getId());
}
}
}