0

In Android Studio, while debugging the app BluetoothLeGatt, I got the following exception:

Caught a RuntimeException from the binder stub implementation. java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results at android.os.Parcel.readException(Parcel.java:1684) at android.os.Parcel.readException(Parcel.java:1637) at android.bluetooth.IBluetoothGatt$Stub$Proxy.startScan(IBluetoothGatt.java:678) at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.onClientRegistered(BluetoothLeScanner.java:367) at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:56) at android.os.Binder.execTransact(Binder.java:565)

Vikas
  • 11,859
  • 7
  • 45
  • 69

1 Answers1

1

You are missing the android.permission.ACCESS_FINE_LOCATION permission in your Manifest and in your code if you are targeting Android 23 or higher.

Add that permission to manifest.xml as well as your code.

This page explains all you need to know about permissions in your Android app.

Sub 6 Resources
  • 1,674
  • 15
  • 31