This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

register with gatt stack failed Error BLE android

My android app give me this "register with gatt stack failed" error on Samsung S7 marshmallow. The scenario is that I am working with 21 BLE peripherals (nrf52). I scan available devices and then connect => write data => disconnect device one by one. After trying a few times, it give me this error. If i exist the application , it is recover back. Please help!

Already Try : Write on main UI thread for all connectGatt, disconnectGatt method.

The following is my logcat :

05-14 17:45:05.254 5018-5200/? E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler: com.example.jinghu.smartmagazine, msg: MESSAGE_STOP_SCAN
05-14 17:45:05.254 5018-5182/? E/BtGatt.ScanManager: default value of curScanSetting 0 is choosen
05-14 17:45:08.064 5018-5115/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:Connected to Device:F5:E8:84:5E:09:XX, linktype is 2
05-14 17:45:08.094 5018-5352/? E/bt_btif: already has a pending command!!
05-14 17:45:08.804 5018-5115/? E/bt_btif_gatt: bta_to_btif_uuid: Unknown UUID length 63201!
05-14 17:45:09.434 24160-24160/com.example.jinghu.smartmagazine E/UartService: mBluetoothGatt nullandroid.bluetooth.BluetoothGatt@4ed0d4f
05-14 17:45:09.604 5018-5352/? E/bt_btif: Connection doesnt exist. Drop indication!
05-14 17:45:10.254 5018-5352/? E/bt_btm: btm_ble_get_search_if search_if=4
05-14 17:45:10.254 5018-5352/? E/bt_btif: bta_gattc_mark_bg_conn unable to find the bg connection mask for: f5:e8:84:5e:09:a6
05-14 17:45:10.294 5018-5352/? E/bt_btm: btm_sec_disconnected :: clear unused flags. p_dev_rec->sm4 : 0
05-14 17:45:10.304 5018-5115/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:DisConnected to Device:F5:E8:84:5E:09:XX
05-14 17:45:10.304 3981-4166/? E/BluetoothEventManager: ACTION_ACL_DISCONNECTED
05-14 17:45:10.324 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.324 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.324 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.344 5018-5018/? E/BluetoothPbapService: Device  F5:E8:84:5E:09:A6 not waiting for authorization..Skipping cancel dialog...
05-14 17:45:10.424 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.424 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.424 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.494 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.494 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.494 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.584 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.584 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.584 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.694 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.694 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.694 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:10.754 24160-24160/com.example.jinghu.smartmagazine E/ViewRootImpl: sendUserActionEvent() mView == null
05-14 17:45:12.054 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:12.054 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:12.054 5018-5352/? E/bt_btif: Register with GATT stack failed.
05-14 17:45:12.064 5018-5352/? E/bt_btif: bta_gattc_deregister Deregister Failedm unknown client cif
05-14 17:45:33.104 3528-4160/? E/Watchdog: !@Sync 1813 [05-14 17:45:33.111]
05-14 17:46:03.104 3528-4160/? E/Watchdog: !@Sync 1814 [05-14 17:46:03.113]
05-14 17:46:33.104 3528-4160/? E/Watchdog: !@Sync 1815 [05-14 17:46:33.115]
Related