Android BLE: "Scan failed, reason app registration failed for UUID"

On the older implementations of Android there seems to be a race condition between the time a bluetooth adapter is enabled and how quickly you can do a scan. You can trigger this error by either trying to scan with a disabled bluetooth adapter or one that is transitioning (or has open connections and is trying to read). The underlying issue that was causing it in my app was the inability of the bluetooth sub system to get a new bluetooth socket. The answer above (running out of GATT resources) could be part of it. The overall logic in an older Android device to avoid this issue is: 1. Make sure you disable/enable the bluetooth adapter about every 5 scans. This seems to help clear out older cached data. 2. Make sure you don't try to initiate a scan while the bluetooth adapter is not enabled (this is made possible if you are disabling/enabling on a regular basis). 3. Make sure you have a delay between disconnecting from GATT interfaces and doing your next scan. 4. Don't try to read the GATT characteristics of any more than about 3 devices at a time.

Overall, its somewhat unavoidable in an older Android device to completely avoid the problem but you can mitigate it by carefully timing your scan/stop scan/connect/disconnect/ cycle.


The problem is that after couple of connections you reach a maximal number of BluetoothGatt objects.

After you disconnect every device before you start a new scan call close() on your BluetoothGatt object.