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”.
3
Answers
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/
you have to add this code inside your void main(), just after
WidgetsFlutterBinding.ensureInitialized();
You need to give your MacOS app Internet access by adding the following to your
DebugProfile.entitlements
file andRelease.entitlements
file in yourmacOS/Runner
directory:I can’t tell you how long it took me to figure this out.