cordova-plugin-ibeacon: Android 8 IllegalArgumentException: No such service
Hi 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
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 30 (10 by maintainers)
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>
Hi., Even i have a crashing issue in android 8 and no logs printed. Can you please explain what is BIND_JOB_SERVICE and org.altbeacon.beacon.service.ScanJob? . Is this specific to your use case?
Thanks
I’ll be releasing v3.6.2 to npm soon. Please watch out for that and give it a try.