Android 8 IllegalArgumentException: No such service
See original GitHub issueHi running this plugin on a oneplus 3t with android 8.0 I receive the following error: java.lang.IllegalArgumentException: No such service ComponentInfo{com.example.myproject/org.altbeacon.beacon.service.ScanJob}
To make it work I had to add the following lines to the AndroidManifest.xml:
<service android:permission="android.permission.BIND_JOB_SERVICE" android:name="org.altbeacon.beacon.service.ScanJob"> </service>
and
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Please you could fix this thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:30 (10 by maintainers)
Top Results From Across the Web
No such service ComponentInfo JobScheduler - Stack Overflow
You need to add the permission android.permission. ... My issue was that my Service was defined as an static inner class. The issue...
Read more >Java.Lang.IllegalArgumentException: No such service ...
User388416 posted. I am using Xamarin Android to build an app which should allow the app keep sending driver's location every 15 minutes...
Read more >IllegalArgumentException - Android Developers
IllegalThreadStateException, Thrown to indicate that a thread is not in an appropriate state for the requested operation.
Read more >JobIntentService is crashing in an AsyncTask on Android O
IllegalArgumentException : Given work is not active: JobWorkItem{id=1 intent=Intent ... 3) Test with an Android 7.1 and Android 8 emulator (8 will crash)...
Read more >com/android/server/job/JobSchedulerService.java - Google Git
private static final int DEFAULT_STANDBY_FREQUENT_BEATS = 43; // ~ 8 hours ... throw new IllegalArgumentException("No such service " + service);.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Actually its better to change the permissions in the plugin.xml. Faced some issues with the above solution. Here is a fork where you can see the changes: https://github.com/vienom/cordova-plugin-ibeacon
The target of a service is the application, the target of the uses-permission is the manifest. Try it like this:
<edit-config file="AndroidManifest.xml" mode="add" target="/manifest/application"> <service android:name="org.altbeacon.beacon.service.ScanJob" android:permission="android.permission.BIND_JOB_SERVICE" /> </edit-config> <edit-config file="AndroidManifest.xml" mode="add" target="/manifest"> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> </edit-config>