Device not authorized to use BluetoothLE
See original GitHub issueHi, just upgraded to react-native-ble-plx from a different ble module. I’m getting an error when I run startDeviceScan
on android 8.0.0, react-native 0.54.4:
Error: Device is not authorized to use BluetoothLE
at new BleError (BleError.js:53)
at parseBleError (BleError.js:68)
at scanListener (BleManager.js:298)
at RCTDeviceEventEmitter.emit (EventEmitter.js:181)
at MessageQueue.__callFunction (MessageQueue.js:353)
at MessageQueue.js:118
at MessageQueue.__guardSafe (MessageQueue.js:316)
at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:117)
at t (RNDebuggerWorker.js:1)
This seems like it would be a permissions problem, but it isn’t.
AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
...
xmlns:tools="http://schemas.android.com/tools">
...
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="23"/>
...
The bleManager reports that bluetooth is “PoweredOn” and I’ve verified this directly.
Whats going wrong here?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Unable to use react native Bluetoothel - Stack Overflow
You need to explicitly ask the user for the permission. I had the same problem and I solved it by adding this code...
Read more >Bluetooth permissions - Android Developers
If your app looks for Bluetooth devices, such as BLE peripherals, declare the BLUETOOTH_SCAN permission. If your app makes the current device discoverable...
Read more >BluetoothLE Enable ? | Apple Developer Forums
BluetoothLE Enable ? ... I have a project to work with BluetoothLE. ... state = @"The app is not authorized to use Bluetooth...
Read more >RxBLELibraries/react-native-ble - Gitter
@dariuszseweryn when I disconnects device and connect again, I get this error. BleError: Device F1:02:00:02:50:49 is not connected.
Read more >iOs and the Exsurgo Performance System
If bluetooth is not allowed, you will see an error "ALERT BleError: Device is not authorized to use BluetoothLE." This means you need...
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 FreeTop 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
Top GitHub Comments
I checked the app install, and despite the fact that the AndroidManifest.xml requests the correct permissions (and a bunch of other permissions as well), Android’s App Info says “No Permissions Granted”.
I went to Settings > Apps and notifications > App permissions > Location Permissions and my app was turned off for some reason. Turning it on resolved the problem.
Looks like even if you ask for permissions in the manifest, Android might not grant them. Apparently the way you solve this is by using react-native’s PermissionsAndroid and asking in app to get location enabled. I’m closing this issue, but we might want to add something about this in the README.
You promised to update the README, imagine how we can make the world a better place by writing 1 line in readme to save hundreds if not thousands of hour for humanity 😃