Search code examples
flutterfirebasemacos

Firebase does not support mac os


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”.


Solution

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

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