firebase 没有活动的包flutterfire_cli

t5zmwmid  于 2023-05-23  发布在  Flutter
关注(0)|答案(2)|浏览(176)

我有一台Linux机器,我通过Snap安装了Flutter。我想在我的项目上设置Crashlytics。其中一个步骤是按照here的说明安装flutterfire_cli
我已经通过flutter pub global activate flutterfire_cli安装了它有点不同,它安装在$HOME/snap/flutter/common/flutter/.pub-cache/bin下。我在PATH中添加了它。我可以在终端上得到指令。
但是,flutterfire_cli失败(即使使用--help--version),显示“No active package flutterfire_cli.”,没有其他任何内容。我相信这是因为Flutter是通过Snap安装在一个有限的环境中的,它无法找到加载运行所需库的路径。
有人遇到过这样的问题吗?你是怎么解决的
先谢谢你了。

环境

KDE neon 5.23,基于Ubuntu 20.04(如果相关)
flutter doctor --verbose的结果:

[✓] Flutter (Channel stable, 2.8.1, on KDE neon User - Plasma 25th Anniversary Edition 5.13.0-25-generic, locale en_US.UTF-8)
    • Flutter version 2.8.1 at /home/erayerdin/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (5 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /home/erayerdin/.sdks/android/
    • Platform android-32, build-tools 32.0.0
    • Java binary at: /snap/android-studio/115/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /snap/android-studio/115/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code
    • VS Code at /snap/code/current
    • Flutter extension version 3.32.0

[✓] Connected device (2 available)
    • 555cd26e (mobile) • 555cd26e • android-arm64  • Android 9 (API 28)
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 97.0.4692.71

• No issues found!
o8x7eapl

o8x7eapl1#

我看过this issue,这个评论帮助了我。
您需要执行dart pub global activate flutterfire_cli而不是flutter pub global activate flutterfire_cli
如果使用bash,请将以下行添加到$HOME/.bashrc文件中:

export PATH="$PATH":"$HOME/.pub-cache/bin"

然后重新启动终端。
如果使用fish,请在终端中执行以下操作:

fish_add_path "$HOME/.pub-cache/bin"
zfycwa2u

zfycwa2u2#

很容易解决!
你只需要像这样用SUDO运行它:sudo flutterfire configure.
只有这个解决方案为我工作!希望它会为你工作!

相关问题