Dosent require permission: BIND_JOB_SERVICE

I was doing some experiments with using JobService and JobScheduler, I followed the the example by android project creating a test service:

I made a class called ActivityService which extends the JobService:


import android.util.Log;

public class ActivityService extends JobService {

    public boolean onStartJob(JobParameters jobParameters) {
        Log.d("ActivityService", "Received to start");

        return false;

    private void createNotification() {

    public boolean onStopJob(JobParameters jobParameters) {
        return false;

And I am starting the service like this:

mScheduler = (JobScheduler) context.getSystemService(JOB_SCHEDULER_SERVICE);

        ComponentName serviceName = new ComponentName(context.getPackageName(),

        JobInfo.Builder builder = new JobInfo.Builder(JOB_ID, serviceName)

        JobInfo myJobInfo =;

        Toast.makeText(context, "Job Scheduled, job will run when " +
                "the constraints are met.", Toast.LENGTH_SHORT).show();

        if (mScheduler!= null){
            mScheduler = null;
            Toast.makeText(context, "Jobs cancelled", Toast.LENGTH_SHORT).show();

And annotations declared:

@UsesServices(services = @ServiceElement(name = "", exported = "true"))
@UsesPermissions(permissionNames = "android.permission.BIND_JOB_SERVICE")

First I had got error the service not found and somehow I managed to fix it but now I face the error:

Runtime Error

Sheduled service (com.kumaraswamy....) does not require android.permission.BIND_JOB_SERVICE

I removed the permission as the error said, the same thing happened. I have also enabled the exported to true. I also tried the class making it class static but that produced the same error. I checked the compiled manifest file and everything well was present. Please tell me if I am doing something wrong.

@MohamedTamer suggested to me to add the permission name in the service element itself, and it worked! Thanks @MohamedTamer !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.