i got this Error i didn’t know how i would to solve it any solution Please.
when i initialise firebase im main function it show me this white screnn and flutter icon:
but when i delete this initliation this firebase app run successfully as it is:
and show me those errors
3
Make sure you have firebase_core in your pubspec.yaml Then, just use the following in your main:
await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, );
run
flutter clean
and
flutter pub get
in your terminal.
If it still fails, please go step by step following the firebase documentation. It should work. https://firebase.google.com/docs/flutter/setup?platform=android
I just forget to add Google services plugin in android/app/build.gradle:
android/app/build.gradle
apply plugin: 'com.google.gms.google-services'
For my problem, I solved it by changing firebase initialization in main.dart as followed.
main.dart
await Firebase.initializeApp(options:DefaultFirebaseOptions.currentPlatform);
Click here to cancel reply.
3
Answers
Make sure you have firebase_core in your pubspec.yaml
Then, just use the following in your main:
run
and
in your terminal.
If it still fails, please go step by step following the firebase documentation. It should work. https://firebase.google.com/docs/flutter/setup?platform=android
I just forget to add Google services plugin in
android/app/build.gradle
:For my problem, I solved it by changing firebase initialization in
main.dart
as followed.