Open lucky-lusa opened 1 year ago
I think I found a fix for that. Please see pull request #431
@lucky-lusa can you verify that it fixes your problem?
Better yet, can you share how did you trigger the bug? So we might be able to write it into example, and perhaps write test for it.
I am using the last version on the develop branch. But without luck using it in the isolate with this fix.
I have the same problem:
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): Failed to handle method call
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): kotlin.UninitializedPropertyAccessException: lateinit property _calendarDelegate has not been initialized
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at com.builttoroam.devicecalendar.DeviceCalendarPlugin.onMethodCall(DeviceCalendarPlugin.kt:115)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at android.os.Handler.handleCallback(Handler.java:789)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at android.os.Handler.dispatchMessage(Handler.java:98)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at android.os.Looper.loop(Looper.java:164)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at android.app.ActivityThread.main(ActivityThread.java:6944)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
E/MethodChannel#plugins.builttoroam.com/device_calendar(28662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Hi,
when I try to use the device calendar in an isolate like onBackgroundMessage
I get an error
PlatformException(error, lateinit property _calendarDelegate has not been initialized, null, kotlin.UninitializedPropertyAccessException: lateinit property _calendarDelegate has not been initialized
Any hint what I am doing wrong?
Flutter doctor output: