oddbit / flutter_facebook_app_events

Flutter Plugin for Facebook App Events
https://pub.dev/packages/facebook_app_events
Apache License 2.0
129 stars 327 forks source link

[Bug]: 0.19.3 Android: kotlin.UninitializedPropertyAccessException: lateinit property appEventsLogger has not been initialized #393

Open hhzhangzy opened 5 days ago

hhzhangzy commented 5 days ago

Is there an existing issue for this?

Current Behavior

Install facebook_app_events: ^0.19.3 and configure Android manifest as documented with facebook_app_id and facebook_client_token Call the ‘logPurchase‘ method E/MethodChannel#flutter.oddbit.id/facebook_app_events( 2737): kotlin.UninitializedPropertyAccessException: lateinit property appEventsLogger has not been initialized.

Expected Behavior

Expected that the plugin would initialize the Facebook SDK

Steps To Reproduce

1.Install facebook_app_events: ^0.19.3[0.19.4, 0.19.2]

  1. configure Android manifest as documented with facebook_app_id and facebook_client_token ` <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> ...

    , andriod/app/src/main/res/values and values-night/styles.xml

    ... ... xxx // xxx representing the configured FaceBook AppId xxxxxxx // xxxxxxx representing the configured FaceBook Token

    `

Test in app: FacebookAppEvents().logPurchase(amount: 1.00, currency: 'USD');

Platform

Android

Flutter Doctor

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [版本 10.0.22631.4460], locale zh-CN)
    • Flutter version 3.19.6 on channel stable at C:\Users\wangr\fvm\versions\3.19.6
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (7 months ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at D:\android SDK
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = D:\android SDK
    • Java binary at: C:\Users\wangr\Downloads\android-studio-2023.2.1.23-windows-exe\android-studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Android Studio (version 2022.2)
    • Android Studio at D:\android
    • 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 version "17.0.6" 2023-01-17

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Users\wangr\Downloads\android-studio-2023.2.1.23-windows-exe\android-studio
    • 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 version "17.0.9" 2023-10-17

[!] Connected device
    ! No devices available

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

! Doctor found issues in 1 category.
antonoddbit commented 5 days ago

Hi @hhzhangzy have you tried put the line on some button and try try to click it?

joaoarmando commented 3 days ago

same here

antonoddbit commented 3 days ago

@joaoarmando could you put paste the code and show the files?

joaoarmando commented 3 days ago

I fixed by following https://stackoverflow.com/questions/70271507/facebook-app-events-not-working-in-flutter

michael-timi commented 1 day ago

I fixed by following https://stackoverflow.com/questions/70271507/facebook-app-events-not-working-in-flutter

didn't fix it for me anyone solution from anyone?