Repository: flutter
Issue: Document platform channel restrictions whose violations lead to "ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized."
Labels: c: crash,d: api docs,customer: crowd,P2,a: plugins,team-framework,triaged-framework

Hi. I just updated my Flutter SDK. Then when I tried to run my main flutter project where i used Sharedpreferences before the runApp, I got this `ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized` error. Then I added `WidgetsFlutterBinding.ensureInitialized()` before `runApp`. My app was successfully installed. But still I am getting the same error in the console. Even I created New Flutter Project (The Incrementer app) and tried running. Still getting this same error log, even though i didn't add the `sharedpreference` dependency.

ERROR LOG:
```E/flutter ( 4991): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
E/flutter ( 4991): 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.
E/flutter ( 4991): 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.
E/flutter ( 4991): #0      defaultBinaryMessenger.<anonymous closure> (package:flutter/src/services/binary_messenger.dart:76:7)
E/flutter ( 4991): #1      defaultBinaryMessenger (package:flutter/src/services/binary_messenger.dart:89:4)
E/flutter ( 4991): #2      MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:140:62)
E/flutter ( 4991): #3      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:35)
E/flutter ( 4991): #4      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:349:48)
E/flutter ( 4991): #5      MethodChannelSharedPreferencesStore.getAll (package:shared_preferences_platform_interface/method_channel_shared_preferences.dart:54:22)
E/flutter ( 4991): #6      SharedPreferences._getSharedPreferencesMap (package:shared_preferences/shared_preferences.dart:166:57)
E/flutter ( 4991): #7      SharedPreferences.getInstance (package:shared_preferences/shared_preferences.dart:33:19)
E/flutter ( 4991): #8      AppTranslations.loadSavedLocale (package:technicalreport/settings/appLang.dart:74:43)
E/flutter ( 4991): #9      main (package:technicalreport/main.dart:13:25)
E/flutter ( 4991): #10     _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:239:25)
E/flutter ( 4991): #11     _rootRun (dart:async/zone.dart:1126:13)
E/flutter ( 4991): #12     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter ( 4991): #13     _runZoned (dart:async/zone.dart:1518:10)
E/flutter ( 4991): #14     runZoned (dart:async/zone.dart:1502:12)
E/flutter ( 4991): #15     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:231:5)
E/flutter ( 4991): #16     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307:19)
E/flutter ( 4991): #17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
```
FLUTTER DOCTOR:
```
[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18362.535], locale en-IN)
    • Flutter version 1.12.13+hotfix.5 at D:\Installed\FlutterSDK
    • Framework revision 27321ebbad (6 days ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\User1\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!
```