Where is Dart's SDK located within /flutter folder?

Android StudioDartFlutter

Android Studio Problem Overview


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

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.

Android Studio Solutions


Solution 1 - Android Studio

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.

Solution 2 - Android Studio

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

Solution 3 - Android Studio

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

Solution 4 - Android Studio

After installing flutter however you choose.

  1. run the following command > flutter sdk-path

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

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

  4. 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

Solution 5 - Android Studio

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

Solution 6 - Android Studio

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

Solution 7 - Android Studio

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.

Solution 8 - Android Studio

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

Solution 9 - Android Studio

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionXY6View Question on Stackoverflow
Solution 1 - Android StudioDanny TuppenyView Answer on Stackoverflow
Solution 2 - Android StudioXY6View Answer on Stackoverflow
Solution 3 - Android StudioAbu YousufView Answer on Stackoverflow
Solution 4 - Android StudioAndrewSView Answer on Stackoverflow
Solution 5 - Android StudioRoc BoronatView Answer on Stackoverflow
Solution 6 - Android StudioStefan ReinView Answer on Stackoverflow
Solution 7 - Android StudioMalkhan singhView Answer on Stackoverflow
Solution 8 - Android StudiochitterView Answer on Stackoverflow
Solution 9 - Android StudioPapiHackView Answer on Stackoverflow