135

Software

MacOS Sierra 10.12.6
Android Studio 3.1.2
Flutter 0.3.2 • channel beta
Tools • Dart 2.0.0-dev.48.0.flutter-fe606f890b
Flutter doctor (no problems found)

Problem

Dart's SDK is supposed to be bundled when Flutter is downloaded according to the documentation:

"The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately"

However, I opened an existing Flutter project with Android Studio and it suggested me to either "Download Dart SDK" or "Open Dart settings":

Image of Android Studio suggesting to "download Dart SDK"

Apparently, I need to "Open Dart settings" and tell Android Studio where to find the Dart' SDK. However, it can't find it within the flutter/ directory.

4
  • 28
    The Dart SDK bundled with flutter is located in the folder flutter/bin/cache/dart-sdk/bin. However, if you have the Flutter plugin installed and are in a Flutter project you should not need to configure this. May 14, 2018 at 3:19
  • 1
    The plugin was already installed i.imgur.com/ggToUXX.png
    – XY6
    May 14, 2018 at 3:39
  • 2
    Thanks, I updated the flutter SDK path and it's working now.
    – XY6
    May 14, 2018 at 3:52
  • Yesterday in first time installed dart via brew, try to find dart sdk via IntelligeIDE but didnt found... Apr 6, 2022 at 6:40

12 Answers 12

192

The Dart SDK lives inside the bin/cache/dart-sdk folder of the Flutter SDK. It will be downloaded the first time you run the flutter command, so may not exist if you've not yet run flutter.

6
  • So I must manually add a specific path to dart-sdk to .zshrc file?
    – Anatoly
    Jul 15, 2020 at 15:25
  • 1
    @Anatoly generally, no - you should not add that path to your PATH explicitly. Generally you will use the flutter command so you shouldn't need this on PATH. Upcoming versions of Flutter will include a dart binary in the normal bin folder so that you can use dart from the command line easily. Jul 16, 2020 at 17:13
  • Hi there ! If I just happened to want to call the dart sdk, I could add bin/cache/dart-sdk to .zshrc file?
    – Gene
    Feb 16, 2021 at 20:05
  • update, yes you can manually add a path to the dart-sdk in flutter and get access to dart from the command line !
    – Gene
    Feb 16, 2021 at 20:22
  • export PATH="$PATH:/Users/gene/development/flutter/bin/cache/dart-sdk"
    – Gene
    Feb 16, 2021 at 20:22
113

The Dart's SDK is located at /flutter/bin/cache/dart-sdk

However, If Android Studio's flutter plugin is installed, the plugin needs to be told where flutter's SDK is located. Android Studio should be able to locate Dart's SDK afterwards:

enter image description here

2
  • 3
    I have flutter-sdk and flutter plugin installed, yet when I imported a dart library project, I still had to point idea to dart sdk folder just like the author of the original question...
    – morgwai
    May 22, 2021 at 16:09
  • What @morgwai has replied is right, we still need path and Thats "/bin/cache/dart-sdk" Abu Yosuf replied Jan 28, 2022 at 11:14
12

I have downloaded flutter sdk via homebrew

For Mac OS: 10.14.5

Android Studio version : Arctic Fox 2020.3.1

Flutter sdk location is /usr/local/Caskroom/flutter/2.5.0/flutter

Dart location: /usr/local/Caskroom/flutter/2.5.0/flutter/bin/cache/dart-sdk

12

If someone is looking for the path to flutter sdk in Linux I found mine here

/home/your_username/flutter/common/flutter/ flutter path /home/your_username/flutter/common/flutter/bin/cache/dart-sdk dart path

9

After installing flutter however you choose.

  1. run the following command

flutter sdk-path

  1. In Android-Studio select File->Setting->Languages & Frameworks->Flutter (assuming you have installed teh flutter plugin)

  2. Populate the "Flutter SDK path:" with the result from (1).

  3. Click apply. The Dart SDK should automatically get populated.

For my installation the values are:

Flutter SDK path: /home/andrew/snap/flutter/common/flutter

Dart SDK path: /home/andrew/snap/flutter/common/flutter/bin/cache/dart-sdk

3
  • 5
    “Could not find a command named "sdk-path".” Jul 13, 2021 at 1:03
  • 1
    no such command as "flutter sdk-path", command doesn't appear to exist Aug 15, 2021 at 16:03
  • best answer by far as others have left out absolute path. this works on Ubuntu 20.04 Aug 20, 2021 at 17:16
4

Run brew info flutter

Then you get the path: e.g. /opt/homebrew/Caskroom/flutter/2.5.3

And there the bin/cache has the dartk-sdk:

/opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk

1
  • Thanks "flutter/bin/cache" is the path Jan 28, 2022 at 10:56
4

Check this:

brew info dart

Output:

Please note the path to the Dart SDK: /opt/homebrew/opt/dart/libexec

1

If you installed Dart on Windows via Chocolatey, you will find it on C:\tools\dart-sdk

1

If Android Studio show - Error: Dart SDK is not configured.
Open console and write: flutter sdk-path. Copy output.
Next Settings (Ctrl+Alt+S) => Languages & Frameworks => Flutter => Flutter SDK path.
Paste SDK path.

0

I have faced this issue,

  1. Go to the folder where you have downloaded flutter and then delete the flutter folder.

  2. Go to your download folder and where you have downloaded the flutter the first time.

  3. Extract this file again where you have deleted the flutter...

This is working for me.

0

Sometimes it is the build directory that he cannot create, suddenly devtools crashes, you can simply recreate it in $HOME/.pub-cache/hosted/pub.dartlang.org/devtools-your-version, then give it the right rights with for example sudo chown -R $USER:$USER $HOME/.pub-cache/hosted/pub.dartlang.org/devtools-your-version/build after re-creating the build directory

-1

Everyone that is still searching for the correct answer should checkout this answer https://stackoverflow.com/a/63409260/9823820.

If you have the flutter SDK installed.

Run:

flutter doctor -v

The first line will show the install path.

Credits go to @Lee Higgins

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.