Scanning bluetooth devices give me empty list (Android 10).
See original GitHub issueI tried this package with 2 devices,
Device 1. I’ve tried scan bluetooth device in android 10 device (Redmi Note 9 : Bluetooth version is 5.0), but callback give me nothing.
Device 2. and then I’ve tried in android 9 device (Realme C2 : Bluetooth version is 4.2), while scanning for devices managed to get a list of devices including the printer. but I can’t connect to the printer I want and terminal shows me like below :
D/BluetoothSocket(28482): close() this: android.bluetooth.BluetoothSocket@1a1c51a, channel: 2, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@80b084b, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@e3b9228mSocket: null, mSocketState: CLOSED
D/BluetoothSocket(28482): close() this: android.bluetooth.BluetoothSocket@1a1c51a, channel: 2, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@80b084b, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@e3b9228mSocket: null, mSocketState: CLOSED
W/System.err(28482): java.io.IOException: bt socket closed, read return: -1
W/System.err(28482): at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:558)
W/System.err(28482): at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:88)
W/System.err(28482): at java.io.InputStream.read(InputStream.java:101)
W/System.err(28482): at com.gprinter.io.BluetoothPort.readData(BluetoothPort.java:130)
W/System.err(28482): at com.example.bluetooth_print.DeviceConnFactoryManager.readDataImmediately(DeviceConnFactoryManager.java:416)
W/System.err(28482): at com.example.bluetooth_print.DeviceConnFactoryManager$PrinterReader.run(DeviceConnFactoryManager.java:496)
E/BluetoothPort(28482): connection device is lost
E/DeviceConnFactoryManager(28482): read 0
D/BluetoothPrintPlugin(28482): stateStreamHandler, current action: android.bluetooth.device.action.ACL_DISCONNECTED
I/flutter (28482): cur device status: 0
*Printer XPrinter BP-428U
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Bluetooth device scan always returns empty list when using ...
The flow's log shows that the scan block was indeed executed. But the list it returned is always empty. I know this cannot...
Read more >Android 10 not working with BLE Bluetooth scanning
To make BLE scanning work on Android apps targeting Android 10 you need ... Access to device location in the background requires permission....
Read more >No devices found during BLE scan on android 10
Hi, all my old BLE projects don't go on android 9 and up. ... StartScanning doesn't go well and rhe devices list remains...
Read more >[Android] Empty array of services is returned #766 - GitHub
Calling .services() returns an empty array. This might be a pairing issue, since if I pair with the device via Android's bluetooth menu,...
Read more >Clear Your Android Device's Bluetooth Cache
Clear Your Android Device's Bluetooth Cache · Open Settings, and then tap Apps. · Tap the Sort icon (the down arrow with three...
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 Free
Top 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
Yes @vborbely , in my case enabling location on the device solved the problem. Anyway I’ve seen that other packages don’t need this setting. Thank you.
I had to enable Location on my phone to sense the devices. I hope this helps.