Closed lukesalter closed 6 months ago
Nevermind! Cracked it with help from this issue: https://github.com/CodeMinion/another_brother/issues/76
Turns out if multiple devices are connected to the printer then only one of them will work on it. Looks like the 'getBluetoothService() called with no BluetoothManagerCallback' error isn't a problem and shows anyway (perhaps that needs looking into?).
I'll add something into my app which states about making sure multiple devices aren't connected via Bluetooth to the printer if ERROR_CONNECT_SOCKET_FAILED is seen.
Closing off!
For some reason Android on a real device (version 2.1.4) is persistently giving me the following error:
W/BluetoothAdapter(29032): getBluetoothService() called with no BluetoothManagerCallback
when trying to connect to the printer resulting in an ERROR_CONNECT_SOCKET_FAILED error.I've tried multiple Android devices and I've tried stripping out all kinds of things from the repository to try and get it to work. All permissions are showing as granted and the label and printer model match perfectly.
The output from the debugger (including my own log) is as follows:
It tries twice and fails. It's perfect on iOS and completes without issue. It's also great when connecting to the same printer via wifi with the same label setting.
The PrintInfo class has the following values:
Any wisdom or thoughts on things I could try would be great. All my googling around the logged issue state that it happens when multiple bluetooth connections are happening at the same time but that could be a red herring?!