Android java.lang.IllegalArgumentException: No such service ComponentInfo JobScheduler-ThrowExceptions

Exception or error:

I tried to create a simple JobScheduler job just to see how it works.
but I keep getting this exception on runtime, I can’t figure it out as I followed the guides step by step.

This is my call:

        ComponentName componentName = new ComponentName(getApplicationContext(), TestService.class);
    JobInfo jobInfo = new JobInfo.Builder(1, componentName).setPeriodic(300000)

    JobScheduler tm =
            (JobScheduler) getApplicationContext().getSystemService(Context.JOB_SCHEDULER_SERVICE);

TestService doesn’t do anything other than extends JobService.

How to solve:

You need to add the permission android.permission.BIND_JOB_SERVICE into your AndroidManifest.xml

<service android:name=".TestService"


Try clean project. It was my case.


My issue was that my Service was defined as an static inner class. The issue resolved itself once I moved the service class into it’s own Java file

Leave a Reply

Your email address will not be published. Required fields are marked *