Dart SDK is not configured {solved}

Below are the solutions /methods to solve Dart SDK is not configured
method 1
I had the same Dart SDK issue and I usedĀ thisĀ for my solution. To remedy the issue without having to use the terminal to test my programs each time the steps I followed are as follows.

  1. Find flutter SDK path. I did so by typing in echo $PATH and finding the path with /flutter/bin.
  2. Assuming your path is something like .../flutter/bin just add on /cache/dart-sdk/bin making it .../flutter/bin/cache/dart-sdk/bin.
  3. This .../flutter/bin/cache/dart-sdk/bin is the location of your Dart SDK. Assuming you say the same Dart SDK is not configured error accompanied by something where you can configure your Dart SDK. You click the configure option and set .../flutter/bin/cache/dart-sdk as your SDK. That should fix your problem. If not head over to the next step.
  4. Open your Android Studio preferences(Command + ‘,’) and go to Languages and Frameworks>Dart.
  5. Under the Dart menu, you should be able to enter your Dart SDK path.

I went through these steps using IntelliJ IDEA so they should be pretty much the same. If that didn’t work, sometimes making a dummy Dart project can get things working again. That fixed a similar issue for me.
method 2
t

o fix this on Android Studio 3.1.3:

  1. File-> Settings (ctrl+alt+s)
  2. Languages and Frameworks -> Dart
  3. Check “Enable Dart support for the project…”
  4. In “Dart SDK path” click in “…” and navigate to flutter SDK directory. Under that directory you’ll find “bin/cache/dart-sdk”. This is the dart sdk path you should use.
  5. Click “Apply”
  6. Close the project and open it again (sometimes you need this step, sometimes doesn’t)

Edit 2019-05-28 – I don’t know how long this option is enabled but I have noticed that in Android Studio 3.4 it’s easier to Enable Dart Support in projects that were developed in other machines.

  1. File -> Sync Project With Gradle Files
  2. After it builds, click in “Enable dart support” in the top of editor panel.
    method 3

18

I am using Win10 Pro;

If you are using Android Studio and getting this message ‘Error: Dart SDK is not found in specified location‘,

My fix was this.

  1. Go to File/Settings or Ctrl+Alt+S to bring up the settings window.
  2. Go down to ‘Language & Frameworks and click on Dart
  3. Check Enable Dart support for the project 'YOUR_PROJECT_NAME'
  4. For the Path Dart SDK path: enter the location where you are storing the flutter directory.
  5. Drill down that directory till you see the Dart SDK directory C:\flutter\bin\cache\dart-sdk. You can also Check SDK update by checking the box and clicking on Check now to get the latest version.

This works too.

method 4
on ubuntu

  1. Install IntelliJ Flutter plugin:
    • CtrlĀ +Ā ShiftĀ +Ā aĀ (Open Actions)
    • Type in search ‘Flutter’ hit enter Install and restart IntelliJ
  2. Configure Flutter Plugin:
    • CtrlĀ +Ā AltĀ +Ā sĀ (Open Settings)
    • Type in search ‘Flutter’, Select option underĀ Language & Frameworks
    • Open terminalĀ which flutterĀ outputĀ PATH_TO_FLUTTER/bin/flutterĀ youĀ ONLY NEEDĀ theĀ PATH_TO_FLUTTERĀ so remove everything fromĀ /bin...
    • Paste the location on theĀ Flutter SDK pathĀ input and apply

That will then ask you to restart IntelliJ and you should get both Flutter and Dart configured:

enter image description here

Good luck!


In case other answers didn’t work for you

If you are using *nixOS or Mac

  1. Open the terminal and type which flutter. You’ll get something like /Users/mac/development/flutter/bin/flutter under that directory go to cache folder here you will find either dart-sdk or (and) dart-sdk.old folder. Copy their paths.
  2. Open preferences by pressing ctrl+alt+s or cmd+, on mac. Under Language & Frameworks choose Dart find Dart SDK path. Put that path you’ve copied at first step to there. Click Apply.

If this didn’t solve the issue you have to also set the Flutter SDK path

  1. UnderĀ Language & Frameworks choose FlutterĀ and findĀ Flutter SDK pathĀ field.
  2. Your flutter SDK path is two step above in the folder hierarchy relative to whichĀ which flutterĀ command gave to you. Set it to the field you’ve found in step 1 of this header. Again click Apply & click save or ok.