Search code examples
flutterdartvisual-studio-code

VSCode Can't Find the PATH To the Flutter SDK


I just tried to execute Flutter: New Project, but it shows an error that could not find a flutter SDK. I've ensured to complete all of the requirements from the flutter doctor.

enter image description here

enter image description here

Is there any way to solve this problem?

Thanks.


Solution

  • On macOS this was solved by following these steps.

    First find where you downloaded the flutter sdk (Can be downloaded from here). It should be in your downloads folder unless you selected somewhere else.

    Next:

    1. Open up Terminal. Run the following command: sudo nano /etc/paths
    2. Enter your password, when prompted.
    3. Go to the bottom of the file, and enter the path you wish to add.
    4. Hit control-x to quit.
    5. Enter “Y” to save the modified buffer.

    If the sdk is downloaded into your Downloads folder, your path to add should be /Users/yourusername/Downloads/flutter/bin

    Lastly, quit and restart your terminal windows and VS Code. After restarting, both apps should recognize flutter and running flutter doctor should now work.