Missing permission request
See original GitHub issueHi, i just run project on Android 7 and it didn’t work( didn’t show any ~BLE devices during scan) because of Binder exception:
W/Binder: 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:1620) at android.os.Parcel.readException(Parcel.java:1573) at android.bluetooth.IBluetoothGatt$Stub$Proxy.startScan(IBluetoothGatt.java:883) at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.onClientRegistered(BluetoothLeScanner.java:375) at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:56) at android.os.Binder.execTransact(Binder.java:453)
After manually adding of :
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
and manually turning on location permission thru app settings, application started to work and show BLE devices around.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7
Top GitHub Comments
Here is the source code with the manifest file fixed and the request to access permissions in the onCreate(). android-BluetoothLeGatt-master 2.zip
GOOGLE. My dude. Please freaking fix your project and add:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>