Closed finnkassaoy closed 1 year ago
Is there any error message?
Pada tanggal Sel, 9 Agu 2022 16:21, finnkassaoy @.***> menulis:
Hello, I am using blue_thermal_printer blue_thermal_printer: ^1.2.3 package for printing in a bluetooth inbuilt thermal printer, but its not getting connected, printer is detected in the dropdown
[image: image] https://user-images.githubusercontent.com/110221089/183613462-85abeb5b-1667-4c97-9da3-9e1ca331149a.png
Best Regards Shakir
— Reply to this email directly, view it on GitHub https://github.com/kakzaki/blue_thermal_printer/issues/155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYBC2ZJNCRW2BQIBQBODQDVYIPKNANCNFSM56ABOQQQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
No it doesnt show any error
Hi I am also having this trouble. Has anyone found a fix to this yet? No errors shown here as well.
void _connect() async { if (_device != null) { bluetooth.isConnected.then((isConnected) { if (isConnected == false) { bluetooth.connect(_device!).catchError((error) { setState(() => _connected = false); }); setState(() => _connected = true); } else { ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Already connected'))); } }); } else { show('No device selected.'); } }
maybe you should change _connect void like this. for me it's working
Hi @nipzyaw88 I have the same problem. It was working fine, after I upgraded my flutter to 3.3.0 it stopped working.
I have not really understood your solution and how it should help.
I really appreciate it, if you can explain it more.
Thank you.
Hi @nipzyaw88 I have the same problem. It was working fine, after I upgraded my flutter to 3.3.0 it stopped working.
I have not really understood your solution and how it should help.
I really appreciate it, if you can explain it more.
Thank you.
well i didn't try this plugin on 3.3.0 yet. i got 2.10.5 n it's working fine. anyway is there any error? please describe what error you got. maybe i can help you.
by the way the change i've made is on the _connect void the if (isConnected == true)
and i set it to false
That's the stack trace when the connect method is called:
E/BThermalPrinterPlugin(26525): Attempt to invoke virtual method 'int java.io.InputStream.read(byte[], int, int)' on a null object reference E/BThermalPrinterPlugin(26525): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.read(byte[], int, int)' on a null object reference E/BThermalPrinterPlugin(26525): at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:803) E/BThermalPrinterPlugin(26525): at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:819) E/BThermalPrinterPlugin(26525): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:417) E/BThermalPrinterPlugin(26525): at id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin.lambda$connect$1$BlueThermalPrinterPlugin(BlueThermalPrinterPlugin.java:531) E/BThermalPrinterPlugin(26525): at id.kakzaki.blue_thermal_printer.-$$Lambda$BlueThermalPrinterPlugin$Ahw9MM_9K6f9UCVqtrNy_jHybcU.run(Unknown Source:6) E/BThermalPrinterPlugin(26525): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) E/BThermalPrinterPlugin(26525): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/BThermalPrinterPlugin(26525): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/BThermalPrinterPlugin(26525): at java.lang.Thread.run(Thread.java:764)
Hi @nipzyaw88 I have the same problem. It was working fine, after I upgraded my flutter to 3.3.0 it stopped working. I have not really understood your solution and how it should help. I really appreciate it, if you can explain it more. Thank you.
well i didn't try this plugin on 3.3.0 yet. i got 2.10.5 n it's working fine. anyway is there any error? please describe what error you got. maybe i can help you.
by the way the change i've made is on the _connect void the
if (isConnected == true)
and i set it to false
I tried it with an external printer and it's working fine. It seems that only the internal printer has a problem.
When I try with an internal app coming with the device, I could print something. So the printers is not broken. Only my app cannot access it anymore.
Is the device connected to android system?
Pada tanggal Rab, 10 Agu 2022 13:13, finnkassaoy @.***> menulis:
No it doesnt show any error
— Reply to this email directly, view it on GitHub https://github.com/kakzaki/blue_thermal_printer/issues/155#issuecomment-1210206801, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYBC24VY3JGFWTRO7MR6WDVYNB73ANCNFSM56ABOQQQ . You are receiving this because you commented.Message ID: @.***>
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Hello, I am using blue_thermal_printer blue_thermal_printer: ^1.2.3 package for printing in a bluetooth inbuilt thermal printer, but its not getting connected, printer is detected in the dropdown and not able to print
Best Regards Shakir