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

Unhandled Exception: Null check operator used on a null value #36

Open
louniv opened this issue Dec 9, 2021 · 1 comment
Open

Unhandled Exception: Null check operator used on a null value #36

louniv opened this issue Dec 9, 2021 · 1 comment

Comments

@louniv
Copy link

louniv commented Dec 9, 2021

Hi,
I am getting the below error while initializing the time zone in main method.

Error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
E/flutter (23742): #0 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:121:86)
E/flutter (23742): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:146:36)
E/flutter (23742): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (23742): #3 FlutterNativeTimezone.getLocalTimezone (package:flutter_native_timezone/flutter_native_timezone.dart:17:24)
E/flutter (23742): #4 configureLocalTimeZone (package:myapp/main.dart:48:60)
E/flutter (23742): #5 main (package:lotusfeet/main.dart:16:9)
E/flutter (23742): #6 _runMainZoned.. (dart:ui/hooks.dart:145:25)
E/flutter (23742): #7 _rootRun (dart:async/zone.dart:1428:13)
E/flutter (23742): #8 _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter (23742): #9 _runZoned (dart:async/zone.dart:1863:10)
E/flutter (23742): #10 runZonedGuarded (dart:async/zone.dart:1851:12)
E/flutter (23742): #11 _runMainZoned. (dart:ui/hooks.dart:141:5)
E/flutter (23742): #12 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:283:19)
E/flutter (23742): #13 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

Please look into it.
Regards,
Shyam

@ublanke
Copy link

ublanke commented Dec 21, 2021

Same issue, for iOS and Android, FlutterNativeTimezone.getLocalTimezone() always returns Null...
(solved) I had called it too early in the app life cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants