skip to Main Content

I have a project which was working fine but after updating Flutter I find a weird error when I run my app from the Android studio debug button

The current Flutter SDK version is 3.3.5.

Because doki_app depends on fluent_ui >=4.3.0 which requires Flutter SDK version  
>=3.7.0, version solving failed.

but when I run it from the terminal every thing works fine.

[✓] Flutter (Channel stable, 3.7.10, on macOS 12.6 21G115 darwin-arm64, locale en-IR)

4

Answers


  1. Go to pubspec.lock file in your project and search for sdks term, then change both the dart and flutter versions due to your machine’s dart and flutter versions.

    sdks:
      dart: ">=2.19.2 <3.0.0"
      flutter: ">=3.7.0"
    

    An IDE or PC restart will make it better.

    Login or Signup to reply.
  2. I guess that you have two different versions of Flutter namely 3.3.5 and 3.7.10 installed on your computer. This is possible because your IDE has its own setting to know where it should look for Flutter SDK which is what is being used as described by your current SDK version

    From the terminal when you are running the flutter command it uses your PATH environment variable to search for an executable matching your command name.

    So my guess is that your IDE and PATH environment variable points to two different Flutter installations on your computer.

    Hence, to solve this you need to either update your PATH environment variable to point to the correct version. Ideally you will need to point it to the more latest 3.7.10 if your planning on using fluent_ui >= 4.3.0

    Login or Signup to reply.
  3. run

    flutter clean
    

    then

    flutter pub upgrade 
    

    then

    flutter clean
    

    then

    flutter run
    

    if still not works run this command

    flutter run --no-sound-null-safety
    
    Login or Signup to reply.
  4. It seems like you are have multiple flutter SDK versions installed on your computer.
    In terminal you have default Flutter version 3.7.10.
    In your Android Studio it seems like you have Flutter version 3.3.5, that’s why you get an error:

    doki_app depends on fluent_ui >=4.3.0 which requires Flutter SDK version  
    >=3.7.0, version solving failed.
    

    Make sure you have Flutter 3.7.10 selected on your Anroid Studio as well.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search