question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BleError: Cannot start scanning operation on certain Android Phones

See original GitHub issue

I am getting the above error on certain android phones when trying to initiate a scan. I am trying to track down exactly what version and model the phones are, but do you have any insight into what would cause this error to be thrown? The call I am making is manager.startDeviceScan([serviceId], {allowDuplicates: false}, async (error, device) => {});

Is it possible that this version of android doesn’t support either allowDuplicates false or scanning by serviceId?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
jbreuer95commented, Dec 2, 2019

I ran into this problem and found some conditions when it occurs and how to prevent it;

  1. It mostly seems to happen on cheaper android phones.
  2. When you are developing and have fast refresh enabled make sure you properly destroy the old ble manager and start a new one. If you don’t, you start multiple ble managers and multiple scans at the same time. This will cause this error for sure. Put a console.log in your scan function to monitor for this.
  3. Dont make your scans very short. I get this sometimes when my scans are 1 or 2 seconds. I now have them at 6 seconds and i dont see this error anymore
1reaction
hsmadecommented, Jan 30, 2019

When I disable bluetooth, then start the app, wait for a bit and re-enable bluetooth, the scanning works. However, it disconnects after a few seconds. This smells of an Android bug

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bleerror: cannot start scanning operation] - You.com | The AI ...
BleError : Cannot start scanning operation on certain Android Phones ... ... When you are developing and have fast refresh enabled make sure...
Read more >
RxBLELibraries/react-native-ble - Gitter
Hello guys. I have read that older verdions of the ble plx lib had problems where no backpressure handling has been applied on...
Read more >
react-native-ble-plx scan does not run when moved inside an ...
I have tested with the following code: import { BleError, BleManager, Device as BlxDevice, LogLevel, } from 'react-native-ble-plx'; ...
Read more >
Cannot Start Scanning Operation Error - CoachCare - Zendesk
To resolve this issue simply perform the following steps: STEP #1: Open Settings on your Smartphone. STEP #2: Go to Bluetooth.
Read more >
BLE scan function not working - Thunkable Community
... as an output no matter what I do. I am using Thunkable Live on an Android phone. ... BleError: Cannot start scanning...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found