How to Fix the “Dart SDK Is Not Configured” Error?

Fix: 'Dart SDK is not configured' Error

Getting started with Flutter development to have the “Dart SDK is Not Configured” error ruin the mood for you? We’ve got you covered!

Importing and exporting projects from GitHub has become a daily chore for programmers. While languages like Python and C offer simple integrations, you might stumble upon a nasty “Dart SDK is Not Configured” error — if you try to import Flutter projects🧐.

To get the project working, you’d have first to tell your config that the third-party file is safe for use

While this bit might sound a little too complicated🤔, you need to crank a few dials, and you’d mostly be good to go!

Dart SDK is not configured

 

Trying to run a project not created on your machine can be a bit finicky, especially regarding the Flutter and Dart SDK. Pair all of this with the already-poor reputation of Android Studio, and the problem becomes rather apparent. 😯

The solution to the Dart SDK config error is not rocket science. Therefore, you need to do the following: 

  • Enable Dart Support
  • Add the Dart SDK path to Android Studio

With that out of the way, this article will primarily showcase the methods for the above solution set. So, on that note, let’s jump right in!

 

 

Steps to Fix the “Dart SDK is Not Configured” Error

Step 1: Fetch the Dart SDK Path

Flutter comes packaged with helpful commands that allow you to gauge specific information about your installation. 

We will be using these built-in commands to get our Dart SDK installation path through the steps below:

    1. To get started, open your Terminal by doing the following — depending on your Operating System:
  • Windows: Press the Start Menu and search for Terminal.
  • macOS: Click the Launchpad in the Dock, and search for Terminal.
  • Linux: Use CTRL + ALT + T to open the Terminal.

 

  1. Next, write the following command and press Enter:
which flutter

 

  1. Lastly, copy the installation path shown and save it for later use. 

Once done, it’s time to open Android Studio on your relevant operating system to save the installation path. 😬

 

 

Step 2: Enable Dart Support

Once you’ve launched the Android Studio, follow the steps below:

  1. For starters, you need to perform the following operations — depending on your Operating System:
    • Windows/Linux: Head to File -> Settings -> Language & Framework -> Dart.
    • macOS: Head to Android Studio -> Preferences -> Languages & Framework -> Dart.

 

  1. Now, find the Enable Dart support for the project… option and checkmark it. 
  2. Lastly, head to the Dart SDK Path and enter the path there. Just be sure to replace the flutter at the end with the following:
cache/dart-sdk

 

Once done, reboot your computer, and you’re pretty much good to go!😯  With that said, here’s a representation of what your path might look like:

/Users/GuidingCode/Data/Development/flutter/bin/cache/dart-sdk

 

 

Conclusion

To resolve the error, you need to reconfigure the SDK path in Android Studio. This can be — quite quickly — done by heading to the settings in Android Studio and copy-pasting the Dart SDK path there. 

However, if you’ve not installed the Dart SDK, then now might be a great time to grab it, or you won’t be able to create with Flutter. 

Be sure to look out for any nasty Flutter-related errors by running flutter doctor in the Terminal. 

In case you’re having difficulty copying the path from the Terminal, we suggest you take its screenshot and type it letter by letter if all comes to naught. 

Lastly, let us know in the comments: 

  • Were you able to resolve the Dart SDK is Not Configured error?
  • Have you found a more straightforward solution to resolve this kind of error?
  • What kind of application are you intending to create using Flutter?
  • Are there any other points or helpful information you believe we missed out on?

Feel free to share this article amongst your friends and peers, so they don’t have to halt their development just because of an annoying error.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Total
0
Share