Я хочу распечатать некоторые ZPL из моего приложения флаттера на принтер Zebra (ZD420). Я использую flutter_zsdk .
print("Searching BL devices");
List<ZebraBluetoothDevice> devices = await FlutterZsdk.discoverBluetoothDevices();
print("Found ${devices.length} BL device(s)");
devices.forEach((ZebraBluetoothDevice printer) {
if (printer.friendlyName.toLowerCase().contains("zebra")) {
print("Running print");
printer.sendZplOverBluetooth(data);
}
});
Принтер хорошо обоснован, печать начинается, но сразу после этого приложение упало, и я получил следующее:
D/BluetoothSocket( 9904): close() this: android.bluetooth.BluetoothSocket@ec3503c, channel: 1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@603a1c5, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@e34171amSocket: android.net.LocalSocket@353f24b impl:android.net.LocalSocketImpl@f933428 fd:java.io.FileDescriptor@a819541, mSocketState: CONNECTED
D/BluetoothSocket( 9904): close() this: android.bluetooth.BluetoothSocket@ec3503c, channel: 1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@603a1c5, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@e34171amSocket: null, mSocketState: CLOSED
E/AndroidRuntime( 9904): FATAL EXCEPTION: Thread-3
E/AndroidRuntime( 9904): Process: com.example.b2icomm, PID: 9904
E/AndroidRuntime( 9904): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 9904): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:151)
E/AndroidRuntime( 9904): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:230)
E/AndroidRuntime( 9904): at tr.gen.devinim.flutterzsdk.FlutterZsdkPlugin$1.run(FlutterZsdkPlugin.java:267)
E/AndroidRuntime( 9904): at java.lang.Thread.run(Thread.java:764)
D/BluetoothSocket( 9904): close() this: android.bluetooth.BluetoothSocket@ec3503c, channel: 1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@603a1c5, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@e34171amSocket: null, mSocketState: CLOSED
W/libEGL ( 9904): eglTerminate() called w/ 1 objects remaining
W/FlutterJNI( 9904): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: flutter/textinput. Response ID: 0
D/BluetoothSocket( 9904): close() this: android.bluetooth.BluetoothSocket@ec3503c, channel: 1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@603a1c5, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@e34171amSocket: null, mSocketState: CLOSED
Большое спасибо за ваши ответы, с наилучшими пожеланиями