'package facebook_app_events version 0.16.0 E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052)

I install the package facebook_app_events version 0.16.0 that includes the latest facebook sdk. The problem is that when I try to log an event or get an anonymous Id it throws a kotlin exception. I upgrade my kotlin version to 1.5.31 also I try with flutter clean.

This is my code, I initialize FacebookAppEvent at the top of my widget like the code example.

facebookAppEvents.logEvent(
  name: 'button_clicked',
  parameters: {
    'button_id': 'registe_buttonr',
   },
);

This is the error:

E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): kotlin.UninitializedPropertyAccessException: lateinit property anonymousId has not been initialized E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at id.oddbit.flutter.facebook_app_events.FacebookAppEventsPlugin.handleGetAnonymousId(FacebookAppEventsPlugin.kt:82) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at id.oddbit.flutter.facebook_app_events.FacebookAppEventsPlugin.onMethodCall(FacebookAppEventsPlugin.kt:55) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at android.os.MessageQueue.next(MessageQueue.java:335) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at android.os.Looper.loop(Looper.java:206) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at android.app.ActivityThread.main(ActivityThread.java:8595) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) E/MethodChannel#flutter.oddbit.id/facebook_app_events(16052): at com.android.inter



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source