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

Error in Windows: Platform channel messages must be sent on the platform thread #66

Open
askandlearn opened this issue May 17, 2024 · 8 comments
Labels
enhancement New feature or request stale

Comments

@askandlearn
Copy link

Hello,
I found an issue using this package on Windows 10.
[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [Version 10.0.22631.3593], locale
en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.7)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.89.1)
[√] Connected device (4 available)
[√] Network resources

Steps to reproduce:

  1. Run any flutter app which uses the CentralManager

Connecting to VM Service at ws://127.0.0.1:51793/-TN8a0R1R50=/ws
flutter: BLE: central manager state changed [ERROR:flutter/shell/common/shell.cc(1015)] The 'dev.flutter.pigeon.bluetooth_low_energy_windows.MyCentralManagerFlutterApi.onDiscovered' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.
See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.
flutter: Data Directory: C:\Users\xxxx\OneDrive\Documents

@askandlearn askandlearn changed the title Error in Windows: platform channel messages Error in Windows: Platform channel messages must be sent on the platform thread May 17, 2024
@yanshouwang
Copy link
Owner

yanshouwang commented May 17, 2024

This is blocked by this issue: flutter/flutter#134346.

But this is not crash the app, you can ignore this warning for now.

@yanshouwang yanshouwang added the enhancement New feature or request label May 17, 2024
@askandlearn
Copy link
Author

Thanks for the reply @yanshouwang!
The problem I have is that the bluetooth does not seem to work on Windows. The Windows version is unable to discover my device. If I compile the same app on Android, the device is detected. This is the error message that was shown. Were you able to discover devices on Windows?

Thanks for all your work on this flutter package. I have really liked it so far!

@yanshouwang
Copy link
Owner

What's the version you are using? Can you provide the scanning codes?

@yanshouwang
Copy link
Owner

Can you test this with 6.0.0 to see if this is resolved?

@askandlearn
Copy link
Author

askandlearn commented Jun 4, 2024 via email

Copy link

github-actions bot commented Jul 5, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jul 5, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@yanshouwang yanshouwang reopened this Aug 30, 2024
@github-actions github-actions bot removed the stale label Aug 30, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants