You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Binder:10909_3
at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1449)
at io.flutter.embedding.engine.FlutterJNI.dispatchPlatformMessage(FlutterJNI.java:1070)
at io.flutter.embedding.engine.dart.DartMessenger.send(DartMessenger.java:282)
at io.flutter.embedding.engine.dart.DartExecutor$DefaultBinaryMessenger.send(DartExecutor.java:470)
at io.flutter.embedding.engine.dart.DartExecutor.send(DartExecutor.java:223)
at io.flutter.plugin.common.BasicMessageChannel.send(BasicMessageChannel.java:106)
at com.rohit.ble_peripheral.BleCallback.onWriteRequest(BlePeripheral.g.kt:490)
at com.rohit.ble_peripheral.BlePeripheralPlugin$gattServerCallback$1.onCharacteristicWriteRequest(BlePeripheralPlugin.kt:373)
at android.bluetooth.BluetoothGattServer$1.onCharacteristicWriteRequest(BluetoothGattServer.java:219)
at android.bluetooth.IBluetoothGattServerCallback$Stub.onTransact(IBluetoothGattServerCallback.java:256)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179)
Steps:
Start advertising from first device
Pair and connect as a second device
call Characteristic.write([0x12, 0x34]) from second device
And crashes in first advertisible device
Please help me!
The text was updated successfully, but these errors were encountered:
@alisherbu seems like the characteristic write handler callback is executing on main thread
you can try to wrap this
with handler.post {} like this
If it works fine for you, the please send a PullRequest for this Fix
java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Binder:10909_3
at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1449)
at io.flutter.embedding.engine.FlutterJNI.dispatchPlatformMessage(FlutterJNI.java:1070)
at io.flutter.embedding.engine.dart.DartMessenger.send(DartMessenger.java:282)
at io.flutter.embedding.engine.dart.DartExecutor$DefaultBinaryMessenger.send(DartExecutor.java:470)
at io.flutter.embedding.engine.dart.DartExecutor.send(DartExecutor.java:223)
at io.flutter.plugin.common.BasicMessageChannel.send(BasicMessageChannel.java:106)
at com.rohit.ble_peripheral.BleCallback.onWriteRequest(BlePeripheral.g.kt:490)
at com.rohit.ble_peripheral.BlePeripheralPlugin$gattServerCallback$1.onCharacteristicWriteRequest(BlePeripheralPlugin.kt:373)
at android.bluetooth.BluetoothGattServer$1.onCharacteristicWriteRequest(BluetoothGattServer.java:219)
at android.bluetooth.IBluetoothGattServerCallback$Stub.onTransact(IBluetoothGattServerCallback.java:256)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179)
Steps:
And crashes in first advertisible device
Please help me!
The text was updated successfully, but these errors were encountered: