mitesh77 / Best-Flutter-UI-Templates

completely free for everyone. Its build-in Flutter Dart.
Other
20.4k stars 4.54k forks source link

run error #2

Closed lucasjinreal closed 5 years ago

lucasjinreal commented 5 years ago
[VERBOSE-2:ui_dart_state.cc(148)] 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 the `WidgetsFlutterBinding.ensureInitialized()` first.
If you're running a test, you can call the `TestWidgetsFlutterBinding.ensureInitialized()` as the first line in your test's `main()` method to initialize the binding.
#0      defaultBinaryMessenger.<anonymous closure> (package:flutter/src/services/binary_messenger.dart:73:7)
#1      defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:86: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)
<asynchronous suspension>                            
invisgoth commented 5 years ago

Hello there is an error in your code. Your are calling something before the app is running. Share your code for get more help

On 13 Sep 2019, at 01:21, JinTian notifications@github.com wrote:

[VERBOSE-2:ui_dart_state.cc(148)] 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 the WidgetsFlutterBinding.ensureInitialized() first. If you're running a test, you can call the TestWidgetsFlutterBinding.ensureInitialized() as the first line in your test's main() method to initialize the binding.

0 defaultBinaryMessenger. (package:flutter/src/services/binary_messenger.dart:73:7)

1 defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:86: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)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
mitesh77 commented 5 years ago

re-created project in flutter 1.9, check new changes. and reclone the project please and check it. (it's run completely fine).

lucasjinreal commented 5 years ago

@mitesh77 Thanks. I'll try. @invisgoth I am just cloned this repo and running this repo itself...

mitesh77 commented 5 years ago

JinTian : It's working fine or some issues?

lucasjinreal commented 5 years ago
[VERBOSE-2:ui_dart_state.cc(148)] 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 the `WidgetsFlutterBinding.ensureInitialized()` first.
If you're running a test, you can call the `TestWidgetsFlutterBinding.ensureInitialized()` as the first line in your test's `main()` method to initialize the binding.
#0      defaultBinaryMessenger.<anonymous closure> (package:flutter/src/services/binary_messenger.dart:73:7)
#1      defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:86: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)
<asynchronous suspension>
#4      OptionalMethodChannel.invokeMethod (pack<…>

Same error, I am flutter 1.9.1 (just upgrade yesterday every new)

lucasjinreal commented 5 years ago

I pulled just now.