当我尝试运行windows应用程序时,抛出了以下错误
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unsupported operation: DefaultFirebaseOptions have not been configured for windows - you can reconfigure this by running the FlutterFire CLI again.
#0 DefaultFirebaseOptions.currentPlatform (package:user_authentication/firebase_options.dart:36:9)
#1 main (package:user_authentication/main.dart:11:37)
#2 _runMain.<anonymous closure> (dart:ui/hooks.dart:134:23)
#3 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
我甚至尝试从根目录Flutterfire cli运行flutterfire configure命令,但未将windows显示为平台支持的选项
i Found 2 Firebase projects. Selecting project my-cool-firebase.
? Which platforms should your configuration support (use arrow keys & space to select)? ›
✔ android
ios
macos
✔ web
2条答案
按热度按时间xdyibdwo1#
我有同样的问题。我假设当你运行
flutterfire configure
命令,它不显示windows和linux选项。由于某种原因dart pub global activate flutterfire_cli
这个命令对我不起作用。什么解决了我的问题是1.我使用
flutter pub add flutterfire_cli
将flutterfire_cli
包手动添加到pubspec.yaml1.然后运行
dart pub global activate flutterfire_cli
完成这两个步骤后,
flutterfire configure --project=<your-project-name>
应该显示windows和linux选项。hujrc8aj2#
尝试运行
flutter pub add firebase_core_desktop
然后
flutterfire configure