0

The flutter version that I am using is 1.14.7-pre.83.

flutter version

Here is a screenshot of the errors shown when I try to build the app after the upgrade.

**Errors shown when I build my project.**

After the ugrade it also said that I need to migrate my project to androidX. I tried to add

android.useAndroidX=true android.enableJetifier=true

in the gradle.properties but it directed me to another problem shown in the screenshot below. It still shows a blank screen. Please help me out on this. enter image description here

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134

2 Answers2

1

You are using the master channel, you can switch to the stable channel

When we believe we have a particularly good build, we promote it to the stable channel. We intend to do this more or less every quarter, but this may vary. We recommend that you use this channel for all production app releases. We may ship hotfixes to the stable channel for high-priority bugs, although our intent is to do this rarely.

Execute:

flutter channel stable
flutter upgrade

https://github.com/flutter/flutter/wiki/Flutter-build-release-channels

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
  • Error -32601 received from application: Method not found – Kaye Louise Feb 01 '20 at 15:51
  • did you switch channel? – Peter Haddad Feb 01 '20 at 15:53
  • It still gives me a blank screen. And this error is still displayed `Error -32601 received from application: Method not found` – Kaye Louise Feb 01 '20 at 15:53
  • Yes I just did. – Kaye Louise Feb 01 '20 at 15:54
  • execute flutter doctor to check – Peter Haddad Feb 01 '20 at 15:54
  • ` Checking Android licenses is taking an unexpectedly long time..Checking Android licenses is taking an unexpectedly long time..Checking Android licenses is taking an unexpectedly long time..Checking Android licenses is taking an unexpectedly long time..Checking Android licenses is taking an unexpectedly long time. • No issues found!` – Kaye Louise Feb 01 '20 at 15:59
  • https://stackoverflow.com/questions/54320270/flutter-error-retrieving-device-properties-for-ro-product-cpu-abi – Peter Haddad Feb 01 '20 at 16:03
  • E/flutter (13333): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. E/flutter (13333): 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. – Kaye Louise Feb 02 '20 at 02:01
0

Solved the problem by adding WidgetsFlutterBinding.ensureInitialized(); to the main() function then press R to hot restart and rebuild state.

Reference: Flutter: Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized