我试图一步一步地遵循所有文档,但我失败了。我正在创建我的第一个应用程序与Flutter和Android Studio上的Windows.
错误:
i Found 0 Firebase projects. Selecting project five-six-seven-and-eight.
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase --version
ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be
installed, see https://firebase.google.com/docs/cli#install_the_firebase_cli for how to install it.
我已经下载:
- 项目文件夹中的独立bin,
- 我已经在firebase.exe中重命名了
- 运行firebase login:ci,将Token保存在系统变量 中
- 正在运行firebase init登录工作,firebase项目:列表工作(我可以在firebase上看到我的项目)。
Flutterfire configure
—>失败了!
我试过通过node.js.
- 我已经下载并安装了Node.js 我已经运行npm install -g firebase-tools我可以看到登录和项目列表,但
Flutterfire configure
仍然失败:获取可用Firebase项目…未处理的例外:FormatException:意外字符(at character 1)#^
- # 0 _ChunkedJsonParser。失败(飞镖:convert-patch/convert_patch.dart: 1383:5)
- # 1 _ChunkedJsonParser。parseNumber(飞镖:convert-patch/convert_patch.dart: 1250:9)
- # 2 _ChunkedJsonParser。解析(飞镖:convert-patch/convert_patch.dart: 915:22)
- #3 _parseJson (dart:convert-patch/convert_patch.dart:35:10) JsonDecoder
- # 4。转换(飞镖:转换/json.dart: 612:36)
- #5 runFirebaseCommand(包:flutterfire_cli/src/firebase.dart:95:25)
- #6 getProjects (package:flutterfire_cli/src/firebase.dart:114:7)
- # 7 ConfigCommand。_selectFirebaseProject(包:flutterfire_cli/src/命令/config.dart: 264:24)
- #8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:351:37)
- #9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
- #10 main (file:///C:/Users/***/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.2+2/bin/flutterfire.dart:57:5)
我已经尝试退出并再次登录。所以,我不知道如何让我的Flutter应用程序在Android工作室看到/链接/匹配我的Firebase项目,所以我可以尝试我的第一个认证。
我已经尝试了上面提到的所有解决方案。这是唯一一个对我有用的,
- 安装node . js
- 将C:UsersusernameAppDataLocalPubCachebin添加到您的系统环境
- 转到您的flutter项目目录并运行cmd
- 执行此命令。
npm install -g firebase-tools
- 运行flutterfire configure命令
希望对你有用
我一天前也遇到过类似的情况。
在很多头痛之后,npm install -g firebase-tools
为我工作。我猜Windows二进制版本有一些bug。
登录firebase运行运行npm install -g firebase-tools
添加FlutterFire到Windows环境变量
C: 用户名 AppData 用户本地缓存 bin 酒店
输入图片描述
运行flutterfire configure --verbose
后尝试了这么多的解决方案为我工作,我不知道为什么,但它工作。