Open ksy5662 opened 4 years ago
Dear JKPK,
Thanks for your great flutter Challenge weather app.
I ran into this problem while uploading to IOS simulator. I really appreciate your help!!
Launching lib/main.dart on iPhone 8 in debug mode... Running Xcode build... Xcode build done. 13.7s [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. If you're running an application and need to access the binary messenger before
runApp()
has been called (for example, during plugin initialization), then you need to explicitly call theWidgetsFlutterBinding.ensureInitialized()
first. If you're running a test, you can call theTestWidgetsFlutterBinding.ensureInitialized()
as the first line in your test'smain()
method to initialize the binding.0 defaultBinaryMessenger. (package:flutter/src/services/binary_messenger.dart:76:7)
1 defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:89:4)
2 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:140:62)
3 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:35)
4 OptionalMethodChannel.invokeMethod (package:flutter/src/services/p<…>
Debug service listening on ws://127.0.0.1:56120/7fD6MV3RihE=/ws Syncing files to device iPhone 8...
solved with WidgetsFlutterBinding.ensureInitialized(); at first line of main()
Thanks,
Dear JKPK,
Thanks for your great flutter Challenge weather app.
I ran into this problem while uploading to IOS simulator. I really appreciate your help!!
Launching lib/main.dart on iPhone 8 in debug mode... Running Xcode build... Xcode build done. 13.7s [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. If you're running an application and need to access the binary messenger before
runApp()
has been called (for example, during plugin initialization), then you need to explicitly call theWidgetsFlutterBinding.ensureInitialized()
first. If you're running a test, you can call theTestWidgetsFlutterBinding.ensureInitialized()
as the first line in your test'smain()
method to initialize the binding.0 defaultBinaryMessenger. (package:flutter/src/services/binary_messenger.dart:76:7)
1 defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:89:4)
2 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:140:62)
3 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:35)
4 OptionalMethodChannel.invokeMethod (package:flutter/src/services/p<…>
Debug service listening on ws://127.0.0.1:56120/7fD6MV3RihE=/ws Syncing files to device iPhone 8...