dotintent / react-native-ble-plx

React Native BLE library
Apache License 2.0
3.05k stars 513 forks source link

[Android 14] startDeviceScan can Not find the ble device after it is disconnected #1139

Closed edwardhsueh closed 11 months ago

edwardhsueh commented 11 months ago

Prerequisites

Question

Hi, in android 14, after my ble device is disconnected and power off, startDeviceScan fails find the ble device again after the device is powered on again. on other Android version, startDeviceScan function works well as expected I have updated to last version of react-native-ble-plx(3.1.2-rc.0) and my phone is google pixel 8

  1. I call startDeviceScan as shown below

    this.manager.startDeviceScan(null, null, (error, device) => { .... }

  2. When startDeviceScan fails to find the ble device, I go to android blutooth setting, I can find the device on the list. I also use another App (nrf connect), it can also find the ble device

  3. I found an interest thing , if I pair my ble device in the android bluetooth setting first, startDeviceScan can find my ble device again

  4. Turn off Bluetooth and then turn on Bluetooth again can also fix this issue

Do you have any idea about how I can fix the problem. Many Thanks

edwardhsueh commented 11 months ago

Finally, the root cause is that I should stopDeviceScan only and if only startDeviceScan is called

pariharkaran commented 5 months ago

Facing same issue on Google Pixel 7 (Android 14), above solution didn't worked for me. If anyone found solution please comment here

JoshuaTLOZ commented 4 months ago

Samsung A52. I use it to control a midi ble device... Update to android14 and midi commander crashes when I try to search ble devices. Work in android13