question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't use dart.sdkPath in preference to Flutter-shipped version of Dart for a Flutter project

See original GitHub issue

Hi, I’m getting an issue with the code. I downloaded the example from VSCode running “Flutter: New Project” and it immediately marked as an error a part of code that Android Studio does not. The incriminated part is

floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add), //this line
      )

errore_flutter

It can’t be an error because it compiles and runs just fine. Also I get plenty of similar errors in another test project I made, errors I don’t get in Android Studio. Is there a way to solve this? Am I missing something? The debugger works fine.

I’m running VSCode x64 1.25.1 on Windows 10 Pro

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Jul 24, 2018

No worries, I think you’ve hit a legit issue. Setting dart.sdkPath has become more common due to all sorts of PATH issues (setting PATH so that it applies outside of the terminal turns out to be complicated on some OSes) so us using it ahead of the Flutter version is probably a bad idea. It was handy for me in the past for testing, but having them mismatch causes other issues anyway.

So, I’m going to use this issue as a task to stop prioritising dart.sdkPath over the embedded one. If anyone wants to change the Flutter Dart SDK version (which they almost certainly don’t), they can rig it themselves internally.

Thanks for the help debugging; and do shout if you have any other issues!

1reaction
DanTupcommented, Jul 24, 2018

You should be able to just run flutter channel dev and then flutter upgrade. See https://github.com/flutter/flutter/wiki/Flutter-build-release-channels

(To change back, you can do flutter channel beta and flutter upgrade)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dart SDK is not configured - Stack Overflow
Open your Android Studio preferences(Command + ',') and go to Languages and Frameworks>Dart . Under the Dart menu, you should be able to...
Read more >
[2022] 7 Steps to Fix Dart SDK is not Configured in Flutter
For Mac: Click Android Studio on top -> Preferences -> Languages & Framework -> Dart. Step 4: Checkmark the “Enable Dart support for...
Read more >
How to keep multiple versions of Flutter | by Ayu - Medium
In this article, I would like to share my experience on how to keep multiple versions of flutter like Stable or Master at...
Read more >
Set up an editor - Flutter documentation
VS Code is a lightweight editor with complete Flutter app execution and debug support. VS Code, latest stable version. Install the Flutter and...
Read more >
Get the Dart SDK
Note: The Flutter SDK includes the full Dart SDK, and has Dart's dart command-line interface in its bin folder. Dart tools may send...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found