Home > Mobile >  Firebase does not support mac os
Firebase does not support mac os

Time:11-13

I am developing an app with flutter. I plan to support Android, iOS, macOS, and windows. But I found that Firebase doesn't work for mac os.

In flutterfire, I chose the following platforms:
✔ Which platforms should your configuration support (use arrow keys & space to select)? · android, ios, macos

But when I ran flutter build -d macos, I got the error “DefaultFirebaseOptions have not been configured for macos”.

CodePudding user response:

Try setting up firebase for macOS using the non flutter fire method - manually downloading a configuration file when you add the macOS app on firebase and including that in your XcodeWorkSpace file.

https://firebase.flutter.dev/docs/manual-installation/macos/

CodePudding user response:

you have to add this code inside your void main(), just after WidgetsFlutterBinding.ensureInitialized();

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

  • Related