简体   繁体   中英

Firebase Flutter does not work in emulator

I configured my flutter project with the Firebase CLI ,
I did it by following the necessary steps in flutter fire docs. I also did the manual installation for the emulator but my problem was not solved
Flutterfire documents: https://firebase.flutter.dev/docs/overview

 My problem is this: 
  (V) Firebase plugins work when I compile it into Flutter WEB
  (X) But it does not work in the emulator.
   * I've done the SHA-KEY additions to the console firebase
   * I've updated the google-services.json file.
   * I also updated two build gradle files

I get the following errors when starting the application
>> Note: Some input files use or override a deprecated API.
>> Note: Recompile with -Xlint:deprecation for details.
i also run the following console codes for this error
flutter pub upgrade
flutter clean
flutter run

these are the warning messages you can ignore them, have you addded the firebase initializer in the main.dart file?

Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

Need to add this line in main.dart

await Firebase.initializeApp(   options: DefaultFirebaseOptions.currentPlatform, );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM