Scan failed with unknown error (errorCode=-99)
See original GitHub issueExpected behavior
The user’s device is able to scan for beacons after updating to 2.13.1.
Actual behavior
The user’s device can’t start scanning for beacons at all since updating to 2.13.1.
Steps to reproduce this behavior
Unclear, since I don’t have access to this device. However, it seems to be a hardware limitation of that particular model or series, based on some prior investigations.
Mobile device model and OS version
Samsung Galaxy J (SC-02F), 5.0
Android Beacon Library version
2.13.1
First of all, thank you for the great work on this library!
We have received a report from one of our users, who can’t scan for beacons at all with their device after updating to the latest version of our app, which increased its AltBeacon dependency from 2.9.2 to the version mentioned above. Prior to the update, we can see that they were able to detect beacons correctly. The user’s application logs show the vague error code -99 repeatedly, which causes the scan to not start.
It was pretty trivial to find a bit more information about this error, which led to a similar issue on another BLE SDK’s Issues page. The description of the maintainer fits the device in question here, since it’s also a Samsung device running on a similar API level, and they tracked it down to limitations regarding the scanning filters on this kind of device. They recommend to check for started scans that aren’t stopped properly. However, since altbeacon abstracts the repeated start/stop cycles away with its start/stopRangingBeaconsInRegion
API, I’m at a loss trying to figure out where the integration might fail. I can verify that the application only calls each of those methods exactly once, and the intermediate scan operations are performed by the SDK itself.
I’m attaching an excerpt of the user’s logs related to BLE. Unfortunately, I can’t ask the user to provide more detailed logs with enabled verbose logging, so I’m aware that this might not be much to go off of.
2018-05-15 15:24:38.064 BLE (i): This is Android 5.0. We are using new scanning APIs
2018-05-15 15:24:38.095 BLE (i): beaconService version 2.13.1 is starting up on the main process
2018-05-15 15:24:38.143 BLE (w): Cannot find match for this device. Using default
2018-05-15 15:24:38.145 BLE (w): Cannot find match for this device. Using default
2018-05-15 15:24:38.149 BLE (i): binding
2018-05-15 15:24:38.965 BLE (i): start ranging received
2018-05-15 15:24:39.117 BLE (e): Scan failed with unknown error (errorCode=-99)
2018-05-15 15:24:41.142 BLE (e): Scan failed with unknown error (errorCode=-99)
2018-05-15 15:24:41.452 BLE (e): Scan failed with unknown error (errorCode=-99)
2018-05-15 15:24:42.456 BLE (e): Scan failed with unknown error (errorCode=-99)
2018-05-15 15:24:43.548 BLE (e): Scan failed with unknown error (errorCode=-99)
(...)
A few more pieces of information about our configuration:
BluetoothMedic#enablePowerCycleOnFailures()
BeaconManager#setForegroundBetweenScanPeriod(100)
BeaconManager#setScannerInSameProcess(true)
BeaconManager#addRangeNotifier()
hooks in 1 listener
Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
Hi, @mannodermaus. I just published a 2.15 release that includes this change.
@davidgyoung, I wanted to reach out again to inquire about any plans to publish this change in the next version of the library. Do you have a timeline for when we can expect to use this fix in a stable release?