flutter commands doesn't execute from terminal, takes forever

1,974

Solution 1

I also have the same problem. The reason for this problem is version conflict between dart sdk and flutter sdk. Try the below options,

Option 1:

  • Close your ide,restart the terminal
  • Remove the cache folder from \flutter_sdk\flutter\bin and run flutter doctor command in terminal. This will try to re-download dart sdk.

Option 2: - Try to upgrade the flutter sdk version. updating via command line is not possible. So download the updated flutter sdk and replace it in current file location.

Solution 2

I got the same issue, just misread the docs. The mistake I was making was that it says-
Extract the zip file and place the contained flutter in the desired installation location for the Flutter SDK (for example, C:\src\flutter; do not install Flutter in a directory like C:\Program Files\ that requires elevated privileges).
which I read as install in C:\Program Files.

Thus extracting the zip file in some accessible location like the one specified should work.

Share:
1,974
Giorgi Margiani
Author by

Giorgi Margiani

Updated on December 08, 2022

Comments

  • Giorgi Margiani
    Giorgi Margiani over 1 year

    I'm new to flutter. I installed VS, dart and flutter inside. Right now I'm following tutorials and learning stuff. Everything was okey, I was working from dart terminal. After I changed channel to "dev" (flutter channel dev) and tried to run app, flutter commands takes forever now, I mean when i press enter in terminal, it receives my command but does nothing, just blinking cursor. Only way out is "ctrl+c", to stop the process. So, I even cannot changes channel back. Even when i Type command "flutter channels", it hangs... I'm working on windows

    I tried restarting VS, PC, reinstalling dart and flutter. non of them works for me.

    enter image description here

    • Vinicius Pinto
      Vinicius Pinto over 5 years
      Run any command with the -v option so Flutter prints logging information.
    • Giorgi Margiani
      Giorgi Margiani over 5 years
      I tried that too, but terminal just takes command and then nothing happens :) even with -v
    • Rubens Melo
      Rubens Melo over 5 years
      make sure to add flutter to your PATH