BLE not scanning for devices
See original GitHub issueI tried to run the code with SDK version 25 and Build tool version 25.0.3. Have got the error as below.
06-20 17:25:45.382 29678-29678/com.example.android.bluetoothlegatt D/BluetoothAdapter: startLeScan(): null
06-20 17:25:45.385 29678-29678/com.example.android.bluetoothlegatt D/BluetoothAdapter: STATE_ON
06-20 17:25:45.395 29678-29692/com.example.android.bluetoothlegatt D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
06-20 17:25:45.400 29678-29692/com.example.android.bluetoothlegatt 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:772)
at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.onClientRegistered(BluetoothLeScanner.java:324)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:56)
at android.os.Binder.execTransact(Binder.java:453)
06-20 17:25:47.404 29678-29879/com.example.android.bluetoothlegatt D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-20 17:25:47.442 29678-29879/com.example.android.bluetoothlegatt I/Adreno: QUALCOMM build : 166ada0, Ifd751822f5
Build Date : 01/26/16
OpenGL ES Shader Compiler Version: XE031.06.00.05
Local Branch : AU12_SBA
Remote Branch :
Remote Branch :
Reconstruct Branch :
06-20 17:25:47.454 29678-29879/com.example.android.bluetoothlegatt I/OpenGLRenderer: Initialized EGL, version 1.4
06-20 17:25:55.381 29678-29678/com.example.android.bluetoothlegatt D/BluetoothAdapter: stopLeScan()
Have got it resolved by adding the following permissions in the manifest.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
java - Unable to scan or discover BT and BLE devices in android
Unable to scan or discover BT and BLE devices in android · 1. First off I have added my permissions under AndroidManifest ·...
Read more >No devices found during BLE scan on android 10
Starting with Android 10, apps that do BLE scanning need to request fine location permission, otherwise no results will be returned. If you...
Read more >Not able to scan bluetooth devices - Microsoft Community
I am not able to connect with bluetooth devices. Bluetooth is installed in my system however it is not working.
Read more >cannot begin scanning for ble devices · Issue #53 - GitHub
Currently on On a mac running nRF connect 2.0.0 BLE App and the start scanning is disabled. i've got a nordic board that...
Read more >Scanning BLE devices - BLE Networking Guide
This function makes a scan to discover a specific BLE device by its MAC address. This function is used to know if a...
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
Why not commit the code