-
Notifications
You must be signed in to change notification settings - Fork 13
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
Possible issue: channel sent a message from native to Flutter on a non-platform thread #4
Comments
I ran into the same warning/issue indicated in the previous message, along with one crasher issue. I affected the followings modifications in a local working copy:
which is not called on the main thread, with DispatchQueue.main.async {}
Not causing an issue, but, there is no need to keep the ids in the map after the reply handler function has been called. Note: since making the above changes, I've not seen any further issues. |
I also made the following changes to: ios/lib/watch_os_observer.dart (which was failing)
|
Code is switch now appears as:
|
@wolfulve any chance you might submit a PR to the repo? I came here because of the same issue. I submitted a PR for the original issue for this post. You had some additional fixes in the code that I don't use so I'm hesitant to include those in my PR. |
I see below message in my log. It seems a method needs to be wrapped in something like:
dispatch_async(dispatch_get_main_queue(), ^{});
[VERBOSE-2:shell.cc(1004)] The 'sstonn/flutter_watch_os_connectivity_callback' 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.
The text was updated successfully, but these errors were encountered: