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

Not building #5

Closed
Vladikasik opened this issue Dec 25, 2020 · 1 comment
Closed

Not building #5

Vladikasik opened this issue Dec 25, 2020 · 1 comment

Comments

@Vladikasik
Copy link

Just tried to run your app in vs code on Nexus_6_API_29

Exception has occurred.
FlutterError (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.)
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
[!] Your app isn't using AndroidX.
    To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY .
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:64214/4NqcdHwbJ_s=/ws
Error handling 'checkPlatformOverride' custom request: ext.flutter.platformOverride: (-32000) Bad state: The client closed with pending request "ext.flutter.platformOverride".
Error handling 'checkBrightnessOverride' custom request: ext.flutter.brightnessOverride: (-32000) Bad state: The client closed with pending request "ext.flutter.brightnessOverride".
@sagarshende23
Copy link
Owner

Add WidgetsFlutterBinding.ensureInitialized();
Before Running MyApp Stateful Widget

Ex:-

void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIOverlays([]);
runApp(MyApp());
}

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