Rexios80 / polar

‎‎‎‎‎This is a Dart plugin wrapper for the Polar SDK on Android and iOS
https://pub.dev/packages/polar
BSD 3-Clause "New" or "Revised" License
17 stars 14 forks source link

lateinit property api has not been initialized #34

Closed Fudal closed 1 month ago

Fudal commented 2 months ago

In new version of plugin I have that error in my logs:

Caused by kotlin.UninitializedPropertyAccessException: lateinit property api has not been initialized
       at dev.rexios.polar.PolarPlugin.onAttachedToActivity$lambda$1(PolarPlugin.kt:177)
       at dev.rexios.polar.PolarPlugin.$r8$lambda$Tn13oyZCYxJhdBeWMHgkp2EYMhA()
       at dev.rexios.polar.PolarPlugin$$ExternalSyntheticLambda5.onStateChanged(D8$$SyntheticClass)
       at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314)
       at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.kt:251)
       at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.kt:287)
       at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.kt:136)
       at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.kt:119)
       at io.flutter.embedding.android.FlutterActivity.onResume(FlutterActivity.java:823)
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1550)
       at android.app.Activity.performResume(Activity.java:8565)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5052)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5113)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:60)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2470)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:240)
       at android.os.Looper.loop(Looper.java:351)
       at android.app.ActivityThread.main(ActivityThread.java:8423)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

OS: Android 13 (OnePlus 8 Pro) Flutter version: 3.22.4

Rexios80 commented 2 months ago

Maybe the same as https://github.com/Rexios80/polar/issues/28

Please try the override in the last comment and let me know if it works

Rexios80 commented 1 month ago

Maybe fixed in version 7.4.0