Closed tazik561 closed 1 year ago
Hi @tazik561 , thank you for reporting this. Several users have been seeing this issue intermittently. We made a fix for a similar issue about 2 months ago in version 2.0.2 of our SDK that helped some users. Others still report it. Would you mind answering a few questions?
1) What version of launchdarkly_flutter_client_sdk
resolved? Please check if it is resolving to at least 2.0.2.
2) Do you see this issue 100% of the time? If not, approximately what frequency?
Thank you!
I am using launchdarkly_flutter_client_sdk: ^2.0.3 and I always see this issue when I want to use it.
I checked 2.0.2 and I got same error.
E/DartMessenger( 5322): Uncaught exception in binary message listener
E/DartMessenger( 5322): com.launchdarkly.sdk.android.LaunchDarklyException: LDClient.get() was called before init()!
E/DartMessenger( 5322): at com.launchdarkly.sdk.android.LDClient.get(LDClient.java:279)
E/DartMessenger( 5322): at com.launchdarkly.launchdarkly_flutter_client_sdk.LaunchdarklyFlutterClientSdkPlugin.onMethodCall(LaunchdarklyFlutterClientSdkPlugin.kt:445)
E/DartMessenger( 5322): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/DartMessenger( 5322): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/DartMessenger( 5322): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/DartMessenger( 5322): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/DartMessenger( 5322): at android.os.Handler.handleCallback(Handler.java:942)
E/DartMessenger( 5322): at android.os.Handler.dispatchMessage(Handler.java:99)
E/DartMessenger( 5322): at android.os.Looper.loopOnce(Looper.java:201)
E/DartMessenger( 5322): at android.os.Looper.loop(Looper.java:288)
E/DartMessenger( 5322): at android.app.ActivityThread.main(ActivityThread.java:7850)
E/DartMessenger( 5322): at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger( 5322): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/DartMessenger( 5322): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/flutter ( 5322): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method allFlags on channel launchdarkly_flutter_client_sdk)
E/flutter ( 5322): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)
E/flutter ( 5322): <asynchronous suspension>
E/flutter ( 5322): #1 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:510:43)
E/flutter ( 5322): <asynchronous suspension>
E/flutter ( 5322): #2 LDClient.allFlags (package:launchdarkly_flutter_client_sdk/launchdarkly_flutter_client_sdk.dart:275:41)
E/flutter ( 5322): <asynchronous suspension>
E/flutter ( 5322): #3 FeatureFlagServiceMobile.getAllFlags (package:rr_launchy/utils/feature_flag_service_mobile.dart:34:39)
E/flutter ( 5322): <asynchronous suspension>
E/flutter ( 5322): #4 FeatureFlagServiceMobile._launchDarklyInit.<anonymous closure> (package:rr_launchy/utils/feature_flag_service_mobile.dart:28:22)
E/flutter ( 5322): <asynchronous suspension>
E/flutter ( 5322):
D/EGL_emulation( 5322): app_time_stats: avg=5782.66ms min=10.26ms max=17192.85ms count=3
Well that's no good. I tested the hello-flutter app earlier today and it worked on my side. Do you have any feature flags created and enabled for the mobile clients? I wonder if an unauthorized error is causing init to fail for some reason. When you create the flag there is a checkbox. See the image below.
Otherwise, is the emulator especially slow? Curious if this bug occurs more depending on machine performance.
I was on Flutter Stable 3.7.7 if that helps.
I have found the issue :
I had this config:
builder.kind('My user Name', '22222222-d216-222-b83e-******');
I added my username instead of the key and my username had a space between its word. I changed to:
builder.kind(bbhbhb', '22222222-d216-222-b83e-******');
and now it is ok . bbhbhb
is dummy key and with dummy key it is working.
Great! We should improve our logging in those situations. I'll take a note.
I am running the project but I got this error:
doctor: