Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu | Flutter Doctor: dart is not in you current flutter SDK

example image

Warning: `dart` on your path resolves to /usr/lib/dart/bin/dart, which is
not inside your current Flutter SDK checkout at /home/ankit/flutter.
Consider adding /home/ankit/flutter/bin to the front of your path.

This exception started when the flutter was updated. How do I solve this?

like image 663
Ankit Kumar Avatar asked Oct 23 '25 11:10

Ankit Kumar


1 Answers

The Problem:

This is happening because you have a separate installation of Dart on your system. The Flutter SDK includes and manages it's own dart SDK, but you can use the dart SDK separately.

Why it Matters

Flutter recommends that you use the dart SDK included with Flutter because Flutter manages it - It will automatically use and upgrade supported versions when using the flutter upgrade command on your terminal, and during initial install.

Flutter is noticing that you have a dart SDK install that did not come with the Flutter SDK. It's giving you a warning because of the possible differences in versions (and possibly other configurations) that could prevent an optimal flutter development experience.

System Path

Here's an explanation of path. You will probably need to set your path environment variables to get the whole fix.

This link shows the official Apple guide to working with the terminal environment variables (including path) but a quick google around should help you find any answers you can't find here.

The path resolves from "front" to "back" - meaning that if the executable in question occurs twice, it will grab the first one. Flutter doctor wants you to add the flutter dart path at the front so that subsequent dart calls will resolve to the Flutter Dart SDK.

The High-Level Solution

Unless you're doing dart development outside flutter, you don't need an additional dart SDK. Most of the time the Flutter dart SDK will work for cases besides flutter as well.

I would recommend removing your other dart install, and using the dart install that comes with flutter. This process will vary depending on how you installed the other dart SDK.

TLDR/Quick Fix

based on what you provided, run this on your Zsh command-line:

export PATH="/home/ankit/flutter/bin:$PATH"

It will only work until you restart your computer.

like image 175
Cabbage Avatar answered Oct 25 '25 01:10

Cabbage



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!