question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug Report: "BleError: Device is not authorized to use BluetoothLE"

See original GitHub issue

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

Please describe the behavior you are expecting

Current Behavior

What is the current behavior?

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. Both JS and platform logs can be enabled via setLogLevel function call.

  • Library version: X.Y.Z
  • Platform: Android/iOS.
  • Platform logs (logcat/XCode):
  • JS logs:
  • Contents of the package.json file:
  • Formatted code sample or link to a repository:
function example(): string {
  return "Your code sample"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
hugowscommented, Jun 23, 2021

My issue is that AndroidManifest.xml is asking for ACCESS_FINE_LOCATION but the runtime code that requests user permission was still referencing ACCESS_COARSE_LOCATION - basic error.

Changing to this makes it work:

  if (Platform.OS === "android" && Platform.Version >= 23) {
    // Scanning: Checking permissions...
    const enabled = yield call(PermissionsAndroid.check, PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
    if (!enabled) {
      // Scanning: Permissions disabled, showing...
      const granted = yield call(PermissionsAndroid.request, PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
      if (granted !== PermissionsAndroid.RESULTS.GRANTED) {
        // Scanning: Permissions not granted, aborting...
        return;
      }
    }
  }
1reaction
KrishnanBharathcommented, May 24, 2019

Check if you have the location permissions turned on for the app… It should work if it is

Read more comments on GitHub >

github_iconTop Results From Across the Web

Device not authorized to use BluetoothLE · Issue #248 - GitHub
I'm getting an error when I run startDeviceScan on android 8.0.0, react-native ... Bug Report: "BleError: Device is not authorized to use ......
Read more >
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 >
RxBLELibraries/react-native-ble - Gitter
I keep getting 'Device is not authorized to use BluetoothLE' on android ... the recent bug report (found here: Polidea/react-native-ble-plx#512) relating to ...
Read more >
A brand new website interface for an even better experience!
Bug Report : "BleError: Device is not authorized to use BluetoothLE"
Read more >
Top 5 react-native-ble-plx Code Examples - Snyk
Learn more about how to use react-native-ble-plx, ... startDeviceScan(null, null, (bleError, device) => { if (bleError) { observer.error(bleError); ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found