firebase Flutterfire cli未将窗口显示为平台支持的选项

bq9c1y66  于 2023-02-16  发布在  Flutter
关注(0)|答案(2)|浏览(246)

当我尝试运行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
xdyibdwo

xdyibdwo1#

我有同样的问题。我假设当你运行flutterfire configure命令,它不显示windows和linux选项。由于某种原因dart pub global activate flutterfire_cli这个命令对我不起作用。什么解决了我的问题是
1.我使用flutter pub add flutterfire_cliflutterfire_cli包手动添加到pubspec.yaml
1.然后运行dart pub global activate flutterfire_cli
完成这两个步骤后,flutterfire configure --project=<your-project-name>应该显示windows和linux选项。

hujrc8aj

hujrc8aj2#

尝试运行flutter pub add firebase_core_desktop
然后flutterfire configure

相关问题