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

前端 未结 3 640
花落未央
花落未央 2020-12-15 18:49

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 gui

相关标签:
3条回答
  • 2020-12-15 19:20

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

    ...
    <service android:name=".TestService"
         android:permission="android.permission.BIND_JOB_SERVICE"
         android:exported="true"/>
    ...
    </application>
    

    0 讨论(0)
  • 2020-12-15 19:21

    Try clean project. It was my case.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题