Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
hhzhangzy opened this issue Nov 20, 2024 · 5 comments
Labels
bug🐞 Something isn't working

Comments

@hhzhangzy
Copy link

hhzhangzy commented Nov 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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]
2. configure Android manifest as documented with facebook_app_id and facebook_client_token
<application android:label='xxxx'> <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> ... <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/> </application >
, andriod/app/src/main/res/values and values-night/styles.xml
<resources> ... <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> <!-- Show a splash screen on the activity. Automatically removed when the Flutter engine draws its first frame --> <item name="android:windowBackground">@drawable/launch_background</item> </style> ... <string name="facebook_app_id">xxx</string> // xxx representing the configured FaceBook AppId <string name="facebook_client_token">xxxxxxx</string> // xxxxxxx representing the configured FaceBook Token </resources>

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.
@hhzhangzy hhzhangzy added the bug🐞 Something isn't working label Nov 20, 2024
@hhzhangzy hhzhangzy changed the title [Bug]: 0.19.2 Android: kotlin.UninitializedPropertyAccessException: lateinit property appEventsLogger has not been initialized [Bug]: 0.19.3 Android: kotlin.UninitializedPropertyAccessException: lateinit property appEventsLogger has not been initialized Nov 20, 2024
@antonoddbit
Copy link
Contributor

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

@joaoarmando
Copy link

same here

@antonoddbit
Copy link
Contributor

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

@joaoarmando
Copy link

@michael-timi
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants