Flutter_CLI: Because every version of flutterfire_cli depends on xml >=5.3.0 which requires SDK version >=2.14.0 <3.0.0, flutterfire_cli is forbidden

294

Try this:

  1. Change your sdk version in pubspec.yaml to sdk: ">=2.17.3 <3.0.0"
  2. Run dart --version to make sure the new path is working
  3. Run flutter clean
  4. Run the app
Share:
294
S_Rollan
Author by

S_Rollan

Updated on January 05, 2023

Comments

  • S_Rollan
    S_Rollan over 1 year

    I am trying to install firebase_cli for my flutter project, but it tells me:

    "Because every version of flutterfire_cli depends on xml >=5.3.0 which requires SDK version >=2.14.0 <3.0.0, flutterfire_cli is forbidden"

    Showing that my SDK version is 2.13.4 and it needs 2.14.0 onwards.

    I went to flutter console as administrator and run choco upgrade dart-sdk. It told me I now have version v2.17.3.

    However, I still get the same problem in flutterfire_cli.

    Things I've tried:

    • creating a .bashrc file with the line export PATH="$PATH": "C:\Users\sjrol\OneDrive\Documentos\flutter\.pub-cache\bin" in it (it is the route flutter console told me to save).
    • creating a system environment variable inside PATH that points to my dart folder , with the newer version.
    • In my pubspec.yaml file I've got .

    Then rebooted the PC. Same problem. No idea of what's happening.

    Dart pub global and choco upgrade results (running the firebase console as administrator):

    Flutter doctor (I don't use android studio so no problem, and the android status problem is something I've been facing for a long time and has never given me any problem. Maybe it still has something to do with this?).

    I can tell I'm working with the new dart version in my VSCode now, thanks to the new features it has, but firebase still won't let me install CLI. Thank you in advance for your help.

  • S_Rollan
    S_Rollan almost 2 years
    Just did it. Didn't work sadly...
  • S_Rollan
    S_Rollan almost 2 years
    App gives me "[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()" because I got no Firebase_CLI, and still have the old version according to the dart command
  • fsbelinda
    fsbelinda almost 2 years
    .bashrc file is for linux based systems. For windows installation of Flutter, check here. And I'd recommend to uninstall the old Flutter & Dart and install the newest. For the Firebase initializeApp() error, it's probably that you have to initialize Firebase inside void main() or something like that, or a missing package that you have to get from pub.
  • S_Rollan
    S_Rollan almost 2 years
    I'll try that. And no, I have the initializeApp(), and gives that error, according to some other forums from some months ago, because I dont have Firebase_CLI, which is why I was trying to install it. I may just unistall it all and get all of it from zero.
  • S_Rollan
    S_Rollan almost 2 years
    After many hours, I reinstalled the whole SDK and, after some more error, could make it. I'll accept you answer as thanks.