I get a lot of IllegalArgumentException crashes which I cannot reproduce. 99% of them are from Samsung Galaxy devices. This is the log from Play Store Console:
java.lang.RuntimeException:
at android.os.AsyncTask$3.done (AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:383)
at java.util.concurrent.FutureTask.setException (FutureTask.java:252)
at java.util.concurrent.FutureTask.run (FutureTask.java:271)
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:764)
Caused by: java.lang.IllegalArgumentException:
at android.app.job.JobParameters.completeWork (JobParameters.java:268)
at android.support.v4.app.JobIntentService$JobServiceEngineImpl$WrapperWorkItem.complete (JobIntentService.java:268)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:394)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:383)
at android.os.AsyncTask$2.call (AsyncTask.java:333)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
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:764)
I have 6 JobInentServices which each one updates a widget. Every JobIntentService has a unique 5-digit JOB_ID to avoid any possible conflict with JOB_ID from libraries.
Before my last update I used other JOB_IDs because I suspected that some ID was causing this exception. Now with the new IDs there Is a big increment of these crashes.
Is the change the cause of this? Does the app "remember" the old IDs and now there 2 different IDs for the same JobIntentService? Why this is happening only on Samsung devices? Could be intent the root of this exception? Is there any way to solve this problem?
My code from widget provider:
Intent intent = new Intent(context.getApplicationContext(),
WidgetEcoService.class);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, allWidgetIds);
WidgetEcoService.enqueueWork(context.getApplicationContext(), intent);
My code from JobIntentService:
public static final int JOB_ID = 45454;
public static void enqueueWork(Context context, Intent work) {
enqueueWork(context, WidgetEcoService.class, JOB_ID, work);
}
Thank you in advance.