You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed Dart, flutter and PATH but when i want to create new flutter project from command palette i have this error "command 'flutter.createProject' not found" Even if i open a ready project the syntax is not working
@shariarrazm could you click Help -> Toggle Developer Tools and see if there are errors in the Console tab about failing to activate the extension?
If you open an existing project (for example flutter_gallery from the flutter/examples folder), do you see any errors for that too? Do you get a popup with a "View Logs" button on it?
i have this two errors
Activating extension 'Dart-Code.dart-code' failed: p.startsWith is not a
function.
_logMessageInConsole @ /Applications/Visual Studio
Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3855
[Extension Host] Activating extension `Dart-Code.dart-code` failed:
p.startsWith
is not a function
t.log @ /Applications/Visual…rkbench.main.js:238
On Tue, May 21, 2019 at 3:32 PM Danny Tuppeny ***@***.***> wrote:
@shariarrazm <https://github.com/shariarrazm> could you click Help ->
Toggle Developer Tools and see if there are errors in the Console tab about
failing to activate the extension?
If you open an existing project (for example flutter_gallery from the
flutter/examples folder), do you see any errors for that too? Do you get
a popup with a "View Logs" button on it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1732?email_source=notifications&email_token=ADTLOAWFR4VRZ4Q2YQVVHGTPWP2VTA5CNFSM4HOLABDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV35I7Q#issuecomment-494392446>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADTLOAROTTNEC6FIOYZOMOLPWP2VTANCNFSM4HOLABDA>
.
@shariarrazm Do you have any dart. settings in your VS Code user settings? If so, could you post them here? (I'm specifically interested in if you have dart.sdkPath set).
In that case, you might not need to set dart.flutterSdkPath, but it depends whether the PATH in your bash profile applies to your desktop. The simplest way is just to probably add the setting - but if you ever move Flutter from your desktop, you'll need to update it.
@shariarrazm that looks like the same error. Can you try restarting VS Code, and if you see the same issue, run the Open Workspace Settings command in VS Code and ensure that your current workspace doesn't also have a bad dart.sdkPath value set.
However in addition, resolvePath now has a check for strings so will treat non-strings as undefined in the next version - which would avoid the original failure (instead, just notifying that it can't find the SDK). So nothing to do here now.
In that case, you might not need to set dart.flutterSdkPath, but it depends whether the PATH in your bash profile applies to your desktop. The simplest way is just to probably add the setting - but if you ever move Flutter from your desktop, you'll need to update it.
Activity
DanTup commentedon May 21, 2019
@shariarrazm could you click Help -> Toggle Developer Tools and see if there are errors in the Console tab about failing to activate the extension?
If you open an existing project (for example
flutter_galleryfrom theflutter/examplesfolder), do you see any errors for that too? Do you get a popup with a "View Logs" button on it?shariarrazm commentedon May 21, 2019
DanTup commentedon May 21, 2019
@shariarrazm Do you have any
dart.settings in your VS Code user settings? If so, could you post them here? (I'm specifically interested in if you havedart.sdkPathset).shariarrazm commentedon May 21, 2019
How can i find this?
DanTup commentedon May 21, 2019
Press
Cmd+,(cmd+comma) to open your VS Code settings. It's a JSON file. See if you have "dart.sdkPath" anywhere in there.shariarrazm commentedon May 21, 2019
{
"dart.sdkPath": [
"/Users/ShariarRazm1/Desktop/Flutter/flutter"
],
"[dart]": {},
"files.associations": {
"*.dart": "dart"
}
}
DanTup commentedon May 21, 2019
@shariarrazm remove the
[square brackets]from arounddart.sdkPath, like this:That value should be a
stringnot astring[]array.Let me know if that helps!
DanTup commentedon May 21, 2019
Actually, that's probably not a valid path - you've put a Flutter SDK in
dart.sdkPath. Change it toflutter.sdkPath:Note: If you have added Flutter's
binfolder to yourPATHenv variable, you might not need that setting at all.shariarrazm commentedon May 21, 2019
i have this in my .bash_profile export
PATH=/Users/ShariarRazm1/desktop/flutter/bin:$PATH
DanTup commentedon May 21, 2019
In that case, you might not need to set
dart.flutterSdkPath, but it depends whether the PATH in your bash profile applies to your desktop. The simplest way is just to probably add the setting - but if you ever move Flutter from your desktop, you'll need to update it.The setting you want is:
If you want to set the Dart SDK too, it should be:
Let me know if these resolve your issue.
shariarrazm commentedon May 21, 2019
still i have this problem

DanTup commentedon May 21, 2019
@shariarrazm can you click Help -> Toggle Dev Tools and check the console again, to see if there's a different error?
shariarrazm commentedon May 21, 2019
DanTup commentedon May 21, 2019
@shariarrazm that looks like the same error. Can you try restarting VS Code, and if you see the same issue, run the Open Workspace Settings command in VS Code and ensure that your current workspace doesn't also have a bad
dart.sdkPathvalue set.shariarrazm commentedon May 21, 2019
Now its working! Thank you very much!
DanTup commentedon May 21, 2019
Great! Do open issues if you have any other problems :-)
[-]VSCode command 'flutter.createProject' not found[/-][+]Improve failure if sdkPath is not a string[/+]DanTup commentedon May 21, 2019
I'm gonna reopen this to improve the failure since it seems like VS Code wasn't giving you a warning when you had an array in that setting.
DanTup commentedon May 22, 2019
Seems like VS Code is validating this for me:
However in addition,
resolvePathnow has a check for strings so will treat non-strings asundefinedin the next version - which would avoid the original failure (instead, just notifying that it can't find the SDK). So nothing to do here now.chubutin commentedon Apr 15, 2020
with both sdk configured and flutter in my path the issue was resolved. Thanks man