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!
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!
Table of Contents
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:
- 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.
- Next, write the following command and press Enter:
- 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:
- 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.
- Now, find the Enable Dart support for the project… option and checkmark it.
- 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:
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:
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.