Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connnect BLE devcie error, under flutter v1.5.9 pre147 #252

Closed
guixue opened this issue May 8, 2019 · 15 comments
Closed

Connnect BLE devcie error, under flutter v1.5.9 pre147 #252

guixue opened this issue May 8, 2019 · 15 comments

Comments

@guixue
Copy link

guixue commented May 8, 2019

I run the example under latest flutter (1.5.9 pre147) version, met an error.

SCAN action is ok, the problem occurred while click CONNECT button.

detail error message as below:

D/BluetoothGatt( 4136): onClientConnectionState() - status=0 clientIf=5 device=10:CE:A9:2F:73:3F
D/FlutterBluePlugin( 4136): [onConnectionStateChange] status: 0 newState: 2
W/BluetoothGatt( 4136): Unhandled exception in callback
W/BluetoothGatt( 4136): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Binder:4136_3
W/BluetoothGatt( 4136): 	at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
W/BluetoothGatt( 4136): 	at io.flutter.embedding.engine.FlutterJNI.dispatchPlatformMessage(FlutterJNI.java:515)
W/BluetoothGatt( 4136): 	at io.flutter.embedding.engine.dart.DartMessenger.send(DartMessenger.java:74)
W/BluetoothGatt( 4136): 	at io.flutter.embedding.engine.dart.DartExecutor.send(DartExecutor.java:163)
W/BluetoothGatt( 4136): 	at io.flutter.view.FlutterNativeView.send(FlutterNativeView.java:152)
W/BluetoothGatt( 4136): 	at io.flutter.plugin.common.MethodChannel.invokeMethod(MethodChannel.java:95)
W/BluetoothGatt( 4136): 	at io.flutter.plugin.common.MethodChannel.invokeMethod(MethodChannel.java:82)
W/BluetoothGatt( 4136): 	at com.pauldemarco.flutterblue.FlutterBluePlugin$8.onConnectionStateChange(FlutterBluePlugin.java:757)
W/BluetoothGatt( 4136): 	at android.bluetooth.BluetoothGatt$1$4.run(BluetoothGatt.java:262)
W/BluetoothGatt( 4136): 	at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:770)
W/BluetoothGatt( 4136): 	at android.bluetooth.BluetoothGatt.access$200(BluetoothGatt.java:39)
W/BluetoothGatt( 4136): 	at android.bluetooth.BluetoothGatt$1.onClientConnectionState(BluetoothGatt.java:257)
W/BluetoothGatt( 4136): 	at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:71)
W/BluetoothGatt( 4136): 	at android.os.Binder.execTransact(Binder.java:735)
D/BluetoothManager( 4136): getConnectionState()
D/BluetoothManager( 4136): getConnectedDevices
I/flutter ( 4136): State refreshed: BluetoothDeviceState.connected
D/BluetoothGatt( 4136): onConnectionUpdated() - Device=10:CE:A9:2F:73:3F interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt( 4136): onConnectionUpdated() - Device=10:CE:A9:2F:73:3F interval=36 latency=0 timeout=500 status=0
D/BluetoothGatt( 4136): close()
D/BluetoothGatt( 4136): unregisterApp() - mClientIf=5

flutter_blue: 0.5(git: 6f6fa30)

Any one can give some advice, thank you!

@mcrovero
Copy link

mcrovero commented May 8, 2019

I'm having the same issue

@mopilo
Copy link

mopilo commented May 11, 2019

any fix yet?

@mopilo
Copy link

mopilo commented May 21, 2019

any solution to this yet please?

@sonnny
Copy link

sonnny commented May 22, 2019

I downgrade flutter to v1.3.0 and it works, code here ------> http://sayaw.net/main_dart.txt

@guixue
Copy link
Author

guixue commented May 28, 2019

the warning maybe coursed by this flutter engine patch: flutter/engine@2c9e37c

guixue added a commit to guixue/flutter_blue that referenced this issue May 28, 2019
…iThread must be executed on the main thread
@guixue
Copy link
Author

guixue commented May 28, 2019

@erik444
Copy link

erik444 commented Jun 3, 2019

I downgrade flutter to v1.3.0 and it works, code here ------> http://sayaw.net/main_dart.txt

I also have the same problem and get the same message as @guixue.

Unfortunately, your solution did not work for me. Do you or anyone else have another suggestions to solve this issue?

Thanks!

@mopilo
Copy link

mopilo commented Jun 3, 2019

Well, I had to use this https://pub.dev/packages/blue_thermal_printer. works for only android

@aaron3481
Copy link

Because now flutter will check if the data passing out from MainThread

@A-Dirt
Copy link

A-Dirt commented Jun 12, 2019

@pauldemarco I have the same problem under the lastest version(1.7.3), I look forward to your solving this problem as soon as possible!

@dmvvilela
Copy link

Same issue here, will they fix this in this plugin?

@casiff
Copy link

casiff commented Jul 12, 2019

Is there now a solution for using flutter 1.7.8 with flutter_blue: 0.5 ?
At the moment I am going back to flutter 1.2.1.

@ghost
Copy link

ghost commented Jul 18, 2019

All of a sudden I started experiencing this... Is there a fix or do we just downgrade flutter?

@casiff
Copy link

casiff commented Jul 19, 2019

I am using flutter 1.7.8 with the fixed flutter_blue 0.5 version of https://github.com/bpillon/flutter_blue.

@pauldemarco
Copy link
Owner

This should be resolved in the version as of June 19.
If not, please re-open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants