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

[Bug] Platform messages do not happen on the main thread on iOS #1384

Open
1 of 4 tasks
navaronbracke opened this issue Oct 8, 2023 · 4 comments
Open
1 of 4 tasks
Assignees
Labels
android Issue applies to Android platform bug Something isn't working feature-candidate This issue might result in a feature to be implemented iOS Issue applies to iOS platform

Comments

@navaronbracke
Copy link
Collaborator

Platform messages do not happen on the main thread on iOS. (have not tested MacOS)

Describe the bug
While fixing #1382 and running the example app to test my change, I had a warning in the console.
See the logs below.

Presumably we are missing switches to the main dispatch queue when sending events back?

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
Any version

How are you picking?
Using the example app

Details to reproduce the issue

  • Run the example app on Flutter stable (3.13.6)
  • Pick an image
  • See the log

Error Log

[VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
flutter: The Dart VM service is listening on http://127.0.0.1:56395/L7zjkDB9z_k=/


***** Picker:<PHPickerViewController: 0x11301e3c0> didFinishPicking:(
    "<PHPickerResult: 0x600000291bc0>"
)
* -[FilePickerPlugin picker:didFinishPicking:] [Line 441]
flutter: FilePickerStatus.picking
[VERBOSE-2:shell.cc(1004)] The 'miguelruivo.flutter.plugins.filepickerevent' 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: FilePickerStatus.done

Screenshots and/or video
N/A

Flutter Version details

[✓] Flutter (Channel stable, 3.13.5, on macOS 13.5.2 22G91 darwin-x64, locale
    en-BE)
    • Flutter version 3.13.5 on channel stable at
      /Users/navaronbracke/Documents/flutter
    • Upstream repository [email protected]:navaronbracke/flutter.git
    • FLUTTER_GIT_URL = [email protected]:navaronbracke/flutter.git
    • Framework revision 12fccda598 (3 weeks ago), 2023-09-19 13:56:11 -0700
    • Engine revision bd986c5ed2
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/navaronbracke/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.83.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.74.0

[✓] Connected device (3 available)
    • iPhone 15 Pro (mobile) • C2B006FF-ECB8-4D7A-B48F-1D3B1D3FE6D6 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS 13.5.2 22G91 darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 117.0.5938.149

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Additional context
N/A

@navaronbracke navaronbracke added the new issue An issue that hasn't yet been seen from the maintainer label Oct 8, 2023
@github-actions
Copy link

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

@github-actions github-actions bot added the stale label Oct 16, 2023
@navaronbracke
Copy link
Collaborator Author

I will work on this when I migrate the plugin to the plugin_platform_interface

@github-actions github-actions bot removed the stale label Oct 17, 2023
@github-actions
Copy link

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

@github-actions github-actions bot added the stale label Oct 25, 2023
@navaronbracke navaronbracke added bug Something isn't working android Issue applies to Android platform iOS Issue applies to iOS platform and removed new issue An issue that hasn't yet been seen from the maintainer stale labels Oct 25, 2023
@navaronbracke navaronbracke self-assigned this Oct 25, 2023
Copy link

github-actions bot commented Nov 2, 2023

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

@github-actions github-actions bot added the stale label Nov 2, 2023
@navaronbracke navaronbracke added feature-candidate This issue might result in a feature to be implemented and removed stale labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issue applies to Android platform bug Something isn't working feature-candidate This issue might result in a feature to be implemented iOS Issue applies to iOS platform
Projects
None yet
Development

No branches or pull requests

1 participant