launchdarkly / flutter-client-sdk

LaunchDarkly Client-side SDK for Flutter mobile applications
Other
15 stars 17 forks source link

The 'launchdarkly_flutter_client_sdk' channel sent a message from native to Flutter on a non-platform thread. #59

Open hongfeiyang opened 7 months ago

hongfeiyang commented 7 months ago

Is this a support request? no

Describe the bug [ERROR:flutter/shell/common/shell.cc(1015)] The 'launchdarkly_flutter_client_sdk' 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.

To reproduce just include launchdarkly_flutter_client_sdk in your project

Expected behavior silence the warning

Logs If applicable, add any log output related to your problem.

SDK version

  - LaunchDarkly (9.1.1):
    - LaunchDarkly/Core (= 9.1.1)
  - LaunchDarkly/Core (9.1.1):
    - LDSwiftEventSource (= 3.1.1)
  - launchdarkly_flutter_client_sdk (0.0.1):
    - Flutter
    - LaunchDarkly (= 9.1.1)

Language version, developer tools Flutter 3.16.4, launch darkly 3.0.1

OS/platform macOS latest as of today, XCode 15.1

Additional context Add any other context about the problem here.

tanderson-ld commented 7 months ago

Hello @hongfeiyang, thank you for reporting this issue.

How frequently are you seeing this issue as a total count and as a percentage of user sessions?

Did this issue begin appearing recently? Perhaps coinciding with updating Flutter or the LaunchDarkly SDK?

Thanks!

hongfeiyang commented 7 months ago

Hello @hongfeiyang, thank you for reporting this issue.

How frequently are you seeing this issue as a total count and as a percentage of user sessions?

Did this issue begin appearing recently? Perhaps coinciding with updating Flutter or the LaunchDarkly SDK?

Thanks!

It happened recently. It's now appearing constantly when app launches. Maybe it's due to flutter's internal changes

tanderson-ld commented 7 months ago

Are you able to track down what changed recently in your code or dependencies that may have caused it? That will help tremendously in tracking this down. Thank you!

michael-joseph-payne commented 6 months ago

I also saw this today for the first time, on iOS.

launchdarkly_flutter_client_sdk: ^2.0.0

Flutter 3.16.4 • channel stable • ssh://git@github.com/flutter/flutter.git Framework • revision 2e9cb0aa71 (4 weeks ago) • 2023-12-11 14:35:13 -0700 Engine • revision 54a7145303 Tools • Dart 3.2.3 • DevTools 2.28.4

[LDEventSource] Initial reply received [LDEventSource] State: connecting -> open [ERROR:flutter/shell/common/shell.cc(1015)] The 'launchdarkly_flutter_client_sdk' 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.

I have not changed anything in the Launch Darkly code in our app for many months now because I don't have enough time to migrate to SDK 3+ right now.

rodrigobastosv commented 3 months ago

Same issue happening here:


Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.2.1 23C71 darwin-arm64, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.88.0)
[✓] Connected device (3 available)
[✓] Network resources