69
votes

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.

5
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. - Jonah Williams
The plugin was already installed i.imgur.com/ggToUXX.png - XY6
Thanks, I updated the flutter SDK path and it's working now. - XY6

5 Answers

113
votes

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.

72
votes

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

4
votes

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

1
votes

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

0
votes

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.