Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode Troubleshooting #34

Open
ctsstc opened this issue Jun 30, 2022 · 5 comments
Open

VSCode Troubleshooting #34

ctsstc opened this issue Jun 30, 2022 · 5 comments

Comments

@ctsstc
Copy link

ctsstc commented Jun 30, 2022

Following the instructions here: https://github.com/oae/asdf-flutter#troubleshooting

I tried adding export FLUTTER_ROOT="$(asdf where flutter)" to my ~/.zshrc and restarted vscode, but couldn't get it to work.

I even tried setting "terminal.integrated.automationProfile.osx" for VSCode but that didn't help.
I also tried putting it in my ~/.bashrc as well with the same results. I thought it worked once until I realized I opened the wrong repository :(

The only thing I could do to get it to work was setting VSCode settings with:

"dart.flutterSdkPaths": ["~/.asdf/installs/flutter/3.0.2"]

I did this at a workspace level so it isn't global, but I would to have a fix that works with any project without additional efforts. I also don't like that this now ultimately requires another location to update versions yet again that can be easily missed and cause headaches. Another problem I have with this is that this now should be committed to the repository and my personal get-around should not be in the repository, although asdf's .tool-versions should be in there, so this seems to be related close enough.

@AlphaLawless
Copy link

Same problem here!

I tried using ${env:VARIABLE} from vscode in the "dart.flutterSdkPath".

Something like: "dart.flutterSdkPath": "${env:FLUTTER_ROOT}". But the dart plugin doesn't support this.

@rdrumond33
Copy link

rdrumond33 commented Aug 8, 2022

@ctsstc

I had this problem too.

But I managed to solve, what I did was put the export FLUTTER_ROOT="$(asdf where flutter)" after where I set the asdf in .zshrc

Example:

If you are only using zsh you probably put the:

. $HOME/.asdf/asdf.sh`
export FLUTTER_ROOT="$(asdf where flutter)"

If I was using ohmyz put it after the configuration:

plugins=(... asdf )
export FLUTTER_ROOT="$(asdf where flutter)"

@sagar-tide
Copy link

Hey, How do I set the path in Intellij?

@2shrestha22
Copy link

Do flutter pub get from terminal then restart VS Code. It will detect flutter.

@ken-ty
Copy link
Collaborator

ken-ty commented Feb 18, 2024

https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments

You should try "terminal.integrated.inheritEnv": false
I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants