andresperezmelo / niimbot_label_printer

Print labels using Niimbot label printers.
Other
0 stars 1 forks source link

Printer not connecting in new flutter version #3

Open HemangSidapara opened 1 month ago

HemangSidapara commented 1 month ago

@andresperezmelo

W/System.err(15444): java.io.IOException: read failed, socket might closed or timeout, read ret: -1
W/System.err(15444):    at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:952)
W/System.err(15444):    at android.bluetooth.BluetoothSocket.waitSocketSignal(BluetoothSocket.java:905)
W/System.err(15444):    at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:527)
W/System.err(15444):    at com.example.niimbot_label_printer.NiimbotLabelPrinterPlugin$onMethodCall$2.invokeSuspend(NiimbotLabelPrinterPlugin.kt:131)
W/System.err(15444):    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err(15444):    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
W/System.err(15444):    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
W/System.err(15444):    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
W/System.err(15444):    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
W/System.err(15444):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
W/System.err(15444):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
W/System.err(15444):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Flutter version: v3.24.3 gradle-wrapper: 8.5-bin

andresperezmelo commented 1 month ago

This java.io.IOException: read failed, socket might closed or timeout error occurs when the Bluetooth connection is unexpectedly closed or the read timeout is exceeded, possibly due to a desynchronization or lack of response from the remote device. Checking permissions (especially since Android 12), ensuring compatibility between devices and updating dependencies may help.

Have you tried connecting to another device to rule out if it is a specific problem?