Onesignal-android-sdk: Apps may not schedule more than 100 distinct jobs

Created on 11 Jun 2019  路  12Comments  路  Source: OneSignal/OneSignal-Android-SDK

Description:

I've got over 2.2k crashes due to "Apps may not schedule more than 100 distinct jobs"
97% of the crashes happened in Samsung mobiles. Other companies include Xiaomi, OnePlus, Lava, Oppo and HMD Global.
And also, 97% of the crashes happened in Android 9 Pie and 3% with Android 8
and device state for all crashes is 100% background.

Environment

  1. I'm using version 3.10.9
  2. I have added SDK in dependencies section in build.gradle

Steps to Reproduce Issue:

  1. Add the OneSignal SDK to your project
  2. Place your App ID in the application's gradle file
  3. Attempt to receive a push notification

But do note that, I don't have any samsung devices to test. I didn't experienced such crashes at my environment. I saw these crashes in Firebase Crashlytics.

Anything else:

Here are the crash logs:

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.onesignal.GcmBroadcastReceiver: java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3584)
at android.app.ActivityThread.access$1300(ActivityThread.java:235)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1779)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

Caused by java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs
at android.os.Parcel.createException(Parcel.java:1974)
at android.os.Parcel.readException(Parcel.java:1934)
at android.os.Parcel.readException(Parcel.java:1884)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:184)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:44)
at com.onesignal.GcmBroadcastReceiver.startGCMServiceWithJobScheduler(GcmBroadcastReceiver.java:178)
at com.onesignal.GcmBroadcastReceiver.startGCMService(GcmBroadcastReceiver.java:146)
at com.onesignal.GcmBroadcastReceiver.processOrderBroadcast(GcmBroadcastReceiver.java:131)
at com.onesignal.GcmBroadcastReceiver.onReceive(GcmBroadcastReceiver.java:72)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3575)
at android.app.ActivityThread.access$1300(ActivityThread.java:235)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1779)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

Caused by android.os.RemoteException: Remote stack trace:
at com.android.server.job.JobSchedulerService.scheduleAsPackage(JobSchedulerService.java:879)
at com.android.server.job.JobSchedulerService$JobSchedulerStub.schedule(JobSchedulerService.java:2588)
at android.app.job.IJobScheduler$Stub.onTransact(IJobScheduler.java:60)
at android.os.Binder.execTransact(Binder.java:739)

Medium Priority

All 12 comments

Hello,
Thank you for reporting this. We will look into the issue and get back to you as soon as we understand what's going on.

Can I have more information on what type of Samsung devices? Also is it a single notification being received or several?

I have tested this this on a Samsung S8+ with Android 9 and placed the OneSignal SDK in 3.10.9
No luck reproducing this crash though

same issue here with OneSignal SDK 3.10.6
%99 Android 9.0
%99 Samsung Devices

Sorry for the delay.
It's happening more in Galaxy A7 (2018) 14%
Galaxy J8 12%
Galaxy A50 8%

Others include, Galaxy A10, J6, A10, S10+, A30, S9+, ....etc

I don't have the affected devices with me. These reports are from Crashlytics.
But the notification sender sends around 10 notification per day. Not all immediately.

This should be fixed in PR #804 which will be included in the next release

Will close since this was fixed in #804 . Just ask to reopen if further issues arise

Hi OneSignal Team, In which version of SDK this " java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs" issue got fixed?

Can you please provide a fixed SDK version details, Thanks !!

Hi @MittapalliHareesh! on SDK version 3.11.2, I hope that helps you!

I am having the latest version of SDK

implementation 'com.onesignal:OneSignal:[3.13.0, 3.99.99]'

with this latest version to i am seeing several firebase velocity alerts with this error
" java.lang.IllegalStateException: Apps may not schedule more than 100 distinct jobs"

Try specifying version explicitly as 3.14.1

Is this issue fixed in 3.14.1 oneSignal SDK ?

It's the latest version as of now and it includes the fix.

Was this page helpful?
0 / 5 - 0 ratings