iamshaunjp / flutter-firebase

All course files for the Flutter & Firebase tutorial playlist on The Net Ninja YouTube channel
578 stars 440 forks source link

[core/not-initialized] Firebase has not been correctly initialized. #40

Open Ayoub-Mentag opened 1 year ago

Ayoub-Mentag commented 1 year ago

I got this error after I we set the (dynamic result = await _auth.signInAnon(); in sign_in.dart ) and I add this code to the main.dart to initialize firebase WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: FirebaseOptions(apiKey: "XXXX", appId: "", messagingSenderId: "", projectId: "XXXX") );

and it works , my issue why we should do that, cause in the course it works without adding these lines.