0

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

Kuro Neko
  • 795
  • 12
  • 19
  • Same error mentioned here; https://stackoverflow.com/questions/69031028/flutter-facebook-app-events-lateinit-property-anonymousid-has-not-been-initial – Timur Turbil May 16 '22 at 14:08
  • Does this answer your question? [Flutter facebook app events : lateinit property anonymousId has not been initialized](https://stackoverflow.com/questions/69031028/flutter-facebook-app-events-lateinit-property-anonymousid-has-not-been-initial) – Dennis Alund Sep 26 '22 at 06:32

0 Answers0