Cheat Sheet for Weird Flutter Errors
Skip the step of reading unrelated StackOverflow answers
This post started as a future reference for all the weird Flutter errors I have encountered and resolved.
Unlike most posts, this one is an ever-growing list as long as I’m still exploring Flutter. Feel free to respond with Stack Overflow question links, GitHub issue links or simply errors to help grow the list further.
For more cheat sheets, see:
Please don’t forget to follow me/SWE Cheat Sheet if you find our cheat sheets helpful ;)
Update:
- Removed the post from paid membership only content as cheat sheets are for everyone and should be free ;)
Your Flutter app refuses to talk to your local backend server
Error message when using Firebase Emulator Suite:
An SSL error has occurred and a secure connection to...
Root cause: iOS by default disallow insecure Http connection.
Resolution: add localhost to Http whitelist by appending the following snippet in [flutter_app_root]/ios/Runner/info.plist
:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
Flutter complain about a generated plugin file
The error message looks like:
info • Unused import: ‘dart:ui’ • lib/generated_plugin_registrant.dart:4:8 • unused_import
Root cause: generated_plugin_registrant.dart
is a generated file for early-stage web support adoption, but flutter analyze
is not ready to recognize this file.
Compilation failure: missing/mismatched transitive dependency
The error message looks like:
Error: The method 'confirmPasswordReset' isn't defined for the class 'FirebaseAuthPlatform'.
Root cause:
Resolution 1: flutter pub upgrade
(one-time fix)
Resolution 2: add the following to pubspec.yaml
(band-aid fix)
firebase_auth_platform_interface:
dependency: transitive
version: 1.1.3