Dart-code: VSCode: Could not find Dart in your flutter SDK

Created on 19 Sep 2018  Â·  35Comments  Â·  Source: Dart-Code/Dart-Code

Get this error message, and it says other places that this is resolved. Seems the "resolved" part is slightly exaggerated. Here is the output of flutter doctor -v running in the VSCode terminal window.

$ flutter doctor -v
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale nb-NO)
• Flutter version 0.8.2 at /Users/terje/bin/flutter
• Framework revision 5ab9e70727 (12 days ago), 2018-09-07 12:33:05 -0700
• Engine revision 58a1894a1c
• Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
• Android SDK at /Users/terje/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 28.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.27.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.18.0

[!] Connected devices
! No devices available

! Doctor found issues in 1 category.

awaiting info

Most helpful comment

I had the same issue after fresh install SDK,

Make sure you have paths in sudo nano /etc/paths and nano ~/.bash_profile more info

  1. I disable plugins for VSC (flutter and dart)
  2. restart VSCode
  3. Enable Plugins (flutter and dart)
  4. command flutter doctor and the problem disappear :)

Hope it helps somebody :)

All 35 comments

See: https://github.com/Dart-Code/Dart-Code/issues/1213

You can not install Flutter in $HOME/bin/flutter, then the plugins fail completely. Not sure that's OK. Moving flutter to $HOME/flutter made everything OK.

Is this just a dupe of #1213 then, or is there a second issue?

I just re-read the title. This message appears when your SDK doesn't have its Dart SDK inside. You'd see it if you downloaded Flutter but had never run it (and therefore the Dart SDK had never been downloaded). That's why the message says to run flutter doctor in a terminal and then reload.

Is this possible what happened here?

This message appears when your SDK doesn't have its Dart SDK inside

Well, when I moved flutter from $HOME/bin/flutter to $HOME/flutter, everything worked as expected, so no, that does not seem to be the problem. However, since I found a work-around, I'll close this one for now.

@tabinnorway What do you mean when you say you "moved" flutter from $HOME/bin/flutter to $HOME/flutter. Does that mean changing the path in the bash_profile? I am unable to save my pubspec.yaml file and I am just guessing if this is the issue. Also, did you specifically get the error "Could not find Dart in your flutter SDK"?

If you're seeing Could not find Dart in your flutter SDK this suggests your flutter SDK has never downloaded Dart. The easiest fix is to run flutter doctor from a terminal, which should cause the SDK (and other dependencies) to be downloaded.

If you still see this error but you can run flutter commands from a terminal without issue, please enable the Extension Log, restart VS Code and repro, then open a new issue with the log and I'll take a look.

Thanks!

(you can also grab me in Gitter when I'm not busy if it's easier to troubleshoot real-time -> https://gitter.im/dart-code/Dart-Code)

i have fixed this issue
Go open another project;
it will allocate memory again ,
then it will be fixed

@Kalyanb447-github I'm suspicious that opening another project should solve this problem. The SDK search is done at startup and will search the same paths each time you open a new project.

If you see this message unexpectedly, please open a new issue with details (and include the contents of the log you get from clicking the Show Log button) and I'll take a look.

Delete Cache folder under flutter/bin

umb7ZRXc0l

I have this problem and I installed the flutter using Git for Desktop can anyone help me with this problem?

@mogovic install the beta version from https://github.com/Dart-Code/Dart-Code/releases/tag/v3.4.0-beta.3 and then when you see this message, click Locate SDK and navigate to your Flutter SDK.

There's a bug in the current live version that prevents Locate SDK from saving correctly (I plan to publish v3.4 with the fix by the end of the day if nothing goes wrong).

and now I'm getting this error.

Code_8I2MSd8qv7

@mogovic what happened when you tried running flutter doctor?

@DanTup @mogovic in my case:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Linux, locale es_CO.UTF-8)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Android Studio (version 3.5)
[✓] Connected device (1 available)

• No issues found!

...
Why the upgrade to 3.4 using github url?

Why the upgrade to 3.4 using github url?

That was a preview version that had a bug fix in it. The fix is now in the live version though, so there's no need to install that version.

Can you clarify the issue you have now? Does flutter doctor run without error, but VS Code still reports it cannot find the Dart SDK in your Flutter SDK? If so, please open a new issue and include the log file you get from clocking the Show Log button on the error dialog. Thanks!

Still does not work for me after run flutter doctor without error, and then VS Code still resports error

Dart Code extension: 3.7.1
Flutter extension: 3.7.1 (not activated)
VS Code: 1.41.1
Platform: mac
HTTP_PROXY: undefined
NO_PROXY: undefined

Thu Jan 23 2020 [14:22:43 GMT+0100 (Central European Standard Time)] Log file started
[2:22:43 PM] [General] [Info] Searching for SDKs...
[2:22:43 PM] [General] [Info] Environment PATH:
[2:22:43 PM] [General] [Info] /usr/local/opt/llvm/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/openssl/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/openssl/bin
[2:22:43 PM] [General] [Info] /Users/gemma/Downloads/google-cloud-sdk/bin
[2:22:43 PM] [General] [Info] /usr/local/openssl/bin
[2:22:43 PM] [General] [Info] /opt/local/bin
[2:22:43 PM] [General] [Info] /opt/local/sbin
[2:22:43 PM] [General] [Info] /Users/gemma./perl5/perlbrew/bin
[2:22:43 PM] [General] [Info] /Users/gemma./perl5/perlbrew/perls/perl-5.16.0/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/apache-maven-3.5.3/bin/
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/apache-maven-3.5.3/bin/
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/bin
[2:22:43 PM] [General] [Info] /usr/bin
[2:22:43 PM] [General] [Info] /bin
[2:22:43 PM] [General] [Info] /usr/sbin
[2:22:43 PM] [General] [Info] /sbin
[2:22:43 PM] [General] [Info] /usr/local
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/tools
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/platform-tools
[2:22:43 PM] [General] [Info] Searching for flutter
[2:22:43 PM] [General] [Info] Looking for flutter in:
[2:22:43 PM] [General] [Info] /Users/gemma./development/flutter
[2:22:43 PM] [General] [Info] /Users/gemma/development/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/llvm/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/openssl/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/openssl/bin
[2:22:43 PM] [General] [Info] /Users/gemma./Downloads/google-cloud-sdk/bin
[2:22:43 PM] [General] [Info] /usr/local/openssl/bin
[2:22:43 PM] [General] [Info] /opt/local/bin
[2:22:43 PM] [General] [Info] /opt/local/sbin
[2:22:43 PM] [General] [Info] /Users/gemma./perl5/perlbrew/bin
[2:22:43 PM] [General] [Info] /Users/gemma./perl5/perlbrew/perls/perl-5.16.0/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/apache-maven-3.5.3/bin/
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/apache-maven-3.5.3/bin/
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/bin
[2:22:43 PM] [General] [Info] /usr/bin
[2:22:43 PM] [General] [Info] /bin
[2:22:43 PM] [General] [Info] /usr/sbin
[2:22:43 PM] [General] [Info] /sbin
[2:22:43 PM] [General] [Info] /usr/local
[2:22:43 PM] [General] [Info] /usr/local/bin
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/tools
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/tools/bin
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/platform-tools
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/platform-tools/bin
[2:22:43 PM] [General] [Info] Found at:
[2:22:43 PM] [General] [Info] /Users/gemma./development/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] Candidate paths to be post-filtered:
[2:22:43 PM] [General] [Info] /Users/gemma./development/flutter
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter
[2:22:43 PM] [General] [Info] Found at /Users/gemma./development/flutter
[2:22:43 PM] [General] [Info] Returning SDK path /Users/gemma./development/flutter for flutter
[2:22:43 PM] [General] [Info] Searching for dart
[2:22:43 PM] [General] [Info] Looking for dart in:
[2:22:43 PM] [General] [Info] /usr/local/opt/llvm/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/openssl/bin
[2:22:43 PM] [General] [Info] /usr/local/opt/openssl/bin
[2:22:43 PM] [General] [Info] /Users/gemma./Downloads/google-cloud-sdk/bin
[2:22:43 PM] [General] [Info] /usr/local/openssl/bin
[2:22:43 PM] [General] [Info] /opt/local/bin
[2:22:43 PM] [General] [Info] /opt/local/sbin
[2:22:43 PM] [General] [Info] /Users/gemma./perl5/perlbrew/bin
[2:22:43 PM] [General] [Info] /Users/gemma./perl5/perlbrew/perls/perl-5.16.0/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/apache-maven-3.5.3/bin/
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/lib/apache-maven-3.5.3/bin/
[2:22:43 PM] [General] [Info] /usr/local/lib/flutter/bin
[2:22:43 PM] [General] [Info] /usr/local/bin
[2:22:43 PM] [General] [Info] /usr/bin
[2:22:43 PM] [General] [Info] /bin
[2:22:43 PM] [General] [Info] /usr/sbin
[2:22:43 PM] [General] [Info] /sbin
[2:22:43 PM] [General] [Info] /usr/local
[2:22:43 PM] [General] [Info] /usr/local/bin
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/tools
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/tools/bin
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/platform-tools
[2:22:43 PM] [General] [Info] /Users/gemma./Library/Android/sdk/platform-tools/bin
[2:22:43 PM] [General] [Info] /Users/gemma./development/flutter/bin/cache/dart-sdk
[2:22:43 PM] [General] [Info] /Users/gemma./development/flutter/bin/cache/dart-sdk/bin
[2:22:43 PM] [General] [Info] Found at:
[2:22:43 PM] [General] [Info] Candidate paths to be post-filtered:
[2:22:43 PM] [General] [Info] Returning SDK path undefined for dart
[2:22:44 PM] [General] [Error] No Dart or Flutter SDK was found. Suppressing prompt because it doesn't appear that a Dart/Flutter project is open.

@next-gemmaarnaiz your issue appears different - it seems like neither the Dart or Flutter SDKs are found. You need to make sure they're in your PATH, or use the Locate button in the error message to point VS Code to them.

If that doesn't work, please open a new issue with a screenshot of the exact message you're seeing. Thanks!

Actually, it seems like you may already have /Users/gemma./development/flutter set as your SDK path. Check that path exists (and that running /Users/gemma./development/flutter/bin/flutter --version works).

But otherwise, please do open a new issue - it's harder to keep track of multiple issues in one GH issue.

I had the same issue after fresh install SDK,

Make sure you have paths in sudo nano /etc/paths and nano ~/.bash_profile more info

  1. I disable plugins for VSC (flutter and dart)
  2. restart VSCode
  3. Enable Plugins (flutter and dart)
  4. command flutter doctor and the problem disappear :)

Hope it helps somebody :)

I had the same issue after fresh install SDK,

Make sure you have paths in sudo nano /etc/paths and nano ~/.bash_profile more info

  1. I disable plugins for VSC (flutter and dart)
  2. restart VSCode
  3. Enable Plugins (flutter and dart)
  4. command flutter doctor and the problem disappear :)

Hope it helps somebody :)

this worked for me, Thanks @redbluenat

FWIW, disabling and re-enabling the extensions is unlikely having any effect here. Running flutter from the command line will cause Flutter to download the Dart SDK if it's missing, and then restarting VS Code will pick it up.

I had the same issue after fresh install SDK,

Make sure you have paths in sudo nano /etc/paths and nano ~/.bash_profile more info

  1. I disable plugins for VSC (flutter and dart)
  2. restart VSCode
  3. Enable Plugins (flutter and dart)
  4. command flutter doctor and the problem disappear :)

Hope it helps somebody :)

Amazing!! it works...thanks a lot

flutter doctor did not automatically download Dart SDK,
but it worked after deleting the cache folder in flutter/bin.
BTW, I got the "Could not find Dart in your flutter SDK" after executing flutter clean in my project directory.

BTW, I got the "Could not find Dart in your flutter SDK" after executing flutter clean in my project directory.

If you can reproduce this, please file a bug - running flutter clean in your project should definitely not remove Flutter's Dart SDK.

I had the same issue after fresh install SDK,

Make sure you have paths in sudo nano /etc/paths and nano ~/.bash_profile more info

  1. I disable plugins for VSC (flutter and dart)
  2. restart VSCode
  3. Enable Plugins (flutter and dart)
  4. command flutter doctor and the problem disappear :)

Hope it helps somebody :)

It also works well for me 💯

Capture vs
I have this error... Can someone help me ?

@RamazanEray have you tried running the command in the error message to see if that completes without error?

run flutter.bat command DOS, locale flutter/bin folder

Screenshot 2021-04-01 at 8 24 43 PM

Screenshot 2021-04-01 at 8 22 16 PM

getting error log : [8:10:55 PM] [General] [Info] Searching for SDKs...
[8:10:55 PM] [General] [Info] Environment PATH:
[8:10:55 PM] [General] [Info] /usr/local/bin
[8:10:55 PM] [General] [Info] /usr/bin
[8:10:55 PM] [General] [Info] /bin
[8:10:55 PM] [General] [Info] /usr/sbin
[8:10:55 PM] [General] [Info] /sbin
[8:10:55 PM] [General] [Info] /Library/Apple/usr/bin
[8:10:55 PM] [General] [Info] /Library/Apple/bin
[8:10:55 PM] [General] [Info] Found Flutter project at /Users/vivekg/Desktop/Flutter/Projects/buttonclick:
Mobile? true
Web? false
Create Trigger? false
Flutter Repo? false
[8:10:55 PM] [General] [Info] Searching for flutter
[8:10:55 PM] [General] [Info] Looking for flutter in:
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/Projects/buttonclick
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/Projects/buttonclick/bin
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/Projects/buttonclick/.flutter
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/Projects/buttonclick/.flutter/bin
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/Projects/buttonclick/vendor/flutter
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/Projects/buttonclick/vendor/flutter/bin
[8:10:55 PM] [General] [Info] /usr/local/bin
[8:10:55 PM] [General] [Info] /usr/bin
[8:10:55 PM] [General] [Info] /bin
[8:10:55 PM] [General] [Info] /usr/sbin
[8:10:55 PM] [General] [Info] /sbin
[8:10:55 PM] [General] [Info] /Library/Apple/usr/bin
[8:10:55 PM] [General] [Info] /Library/Apple/bin
[8:10:55 PM] [General] [Info] Found at:
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/
[8:10:55 PM] [General] [Info] Candidate paths to be post-filtered:
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter
[8:10:55 PM] [General] [Info] Found at /Users/vivekg/Desktop/Flutter/flutter
[8:10:55 PM] [General] [Info] Returning SDK path /Users/vivekg/Desktop/Flutter/flutter for flutter
[8:10:55 PM] [General] [Info] Searching for dart
[8:10:55 PM] [General] [Info] Looking for dart in:
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk/bin
[8:10:55 PM] [General] [Info] /usr/local/bin
[8:10:55 PM] [General] [Info] /usr/bin
[8:10:55 PM] [General] [Info] /bin
[8:10:55 PM] [General] [Info] /usr/sbin
[8:10:55 PM] [General] [Info] /sbin
[8:10:55 PM] [General] [Info] /Library/Apple/usr/bin
[8:10:55 PM] [General] [Info] /Library/Apple/bin
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk/bin
[8:10:55 PM] [General] [Info] Found at:
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk/bin
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk/bin
[8:10:55 PM] [General] [Info] Candidate paths to be post-filtered:
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk
[8:10:55 PM] [General] [Info] /Users/vivekg/Desktop/Flutter/flutter/bin/cache/dart-sdk
[8:10:55 PM] [General] [Info] Returning SDK path undefined for dart

@vivekgajbe have you tried running flutter doctor in the terminal as indicated in the message? If so, what was the output?

yes@DanTup, I have tried "flutter doctor" in terminal --> getting --> connected device(1 available)

Screenshot 2021-04-01 at 8 40 22 PM

@vivekgajbe can you run flutter doctor -v and post the full output? Can you also confirm that you still see this issue in VS Code, after having run flutter doctor at least once? Thanks!

yes @DanTup, Thanks for quick update,
I have check--> VSC(Visual studio code) --> View-->Command palette--> flutter:Run flutter Doctor --> getting same error --->
"Could not find Dart in your Flutter SDK. Please run 'flutter doctor' in the terminal then reload the project once all issues are resolved."

also update "Flutter doctor -v" screenshot in above comment

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kinex picture kinex  Â·  3Comments

ifredom picture ifredom  Â·  3Comments

DanTup picture DanTup  Â·  4Comments

atreeon picture atreeon  Â·  5Comments

e200 picture e200  Â·  3Comments