-
Notifications
You must be signed in to change notification settings - Fork 212
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
[BUG] flutter
still not same with fvm flutter
(fvm 3.0.0)
#599
Comments
@husainazkas, after you |
Sorry there is a missing step on reproduce. Actually I always make myself to very clearly sure that any changes affected by reopen terminal & vscode directly, ofcourse when vscode reopened it will continue last terminal then I always kill & open new terminal. But no luck, it still read global version because of PATH on my |
And also if you look at my |
@husainazkas interesting, there is a settings flag called addSdkToTerminalPath. Can you also confirm that this is set to true? |
ofcourse it's set to true |
any updates? @leoafarias |
I was not able to replicate. Can you do "which flutter" on the vscode terminal and send the output here? |
I think I found possibility reason why this bug happened. Previously, I have set below env to my export PATH=$HOME/fvm/default/bin:$PATH It means global version has been set on user-level env. So If I open vscode that use different flutter version and call But if that flutter global version is not set on .zshrc, I can call Ofcouse I cannot call alias flutter="fvm flutter"
alias dart="fvm dart" My analysis still not fix whole problem, it leaves one more problem. The problem is vscode extension still have weird env config (Idk why) when you call command palette [flutter] flutter doctor -v
[!] Flutter (Channel stable, 3.13.9, on macOS 14.3.1 23D60 darwin-x64, locale en-ID)
• Flutter version 3.13.9 on channel stable at /Users/husainazkas/fvm/versions/3.13.9
! Warning: `flutter` on your path resolves to /Users/husainazkas/fvm/versions/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/husainazkas/fvm/versions/3.13.9. Consider adding /Users/husainazkas/fvm/versions/3.13.9/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/husainazkas/fvm/versions/stable/bin/dart, which is not inside your current Flutter SDK checkout at /Users/husainazkas/fvm/versions/3.13.9. Consider adding /Users/husainazkas/fvm/versions/3.13.9/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (4 months ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/husainazkas/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/husainazkas/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.86.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.82.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 14.3.1 23D60 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119
! Error: Browsing on the local area network for My iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
exit code 0 |
After my fix above, it has succeed show correct output (not sure but at least correct version):
|
I would suggest against doing this. This is a bit weird as I believe dart code extension adds priority over the PATH. But will confirm. One last questions do you have the env FLUTTER_ROOT configured anywhere? |
nope |
I have encounter this issue also with FVM 3.1.4. Interestingly, I am able to setup one project without problem, but the second project I setup got this issue. |
I got it fix by reinstall the VS Code's Flutter & Dart extension |
nano ~/.zshrc Remove all flutter variables then add this (export all flutter versions to the path) # FLUTTER
for dir in $HOME/fvm/versions/*; do
if [ -d "$dir" ]; then
export PATH="$dir/bin:$PATH"
fi
done
export PATH="$HOME/fvm/default/bin:$PATH"
export PATH="$HOME/.pub-cache/bin:$PATH"
alias flutter="fvm flutter"
alias dart="fvm dart" Kill the terminal, and Vscode then open them again |
Same issue here. Sometimes I just simply change SDKs to another one or change to another project and then for no reason flutter doctor and fvm flutter doctor will stop giving the same output. |
The vscode integration needs to happen within the vscode terminal for the behavior to be correct. When running a project-configured flutter sdk outside of vscode, you still have to proxy or create an alias that points to the project symlink. |
I'm doing everything through the vscode terminal and fvm though so no weird actions on my part there. |
Describe the bug
I've read your release changelog for this version which at first point it says fvm will automatically configure VSCode to use the correct Flutter SDK version. So I just need to type
flutter
instead offvm flutter
. The problem is it's not like you describe.To Reproduce
Steps to reproduce the behavior:
fvm use 3.13.9
flutter --version
, you will see Flutter SDK version from globalfvm flutter --version
, you will see Flutter SDK version from current projectExpected behavior
As you describe in changelog, I hope whatever version I use in different project will use correct SDK version, except has not configured with specific version
Logs
flutter
version at current project> flutter --version Flutter 3.16.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision 41456452f2 (3 weeks ago) • 2024-01-25 10:06:23 -0800 Engine • revision f40e976bed Tools • Dart 3.2.6 • DevTools 2.28.5
fvm flutter
version at current project> fvm flutter --version Flutter 3.13.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision d211f42860 (4 months ago) • 2023-10-25 13:42:25 -0700 Engine • revision 0545f8705d Tools • Dart 3.1.5 • DevTools 2.25.0
fvm doctor
at current projectThe text was updated successfully, but these errors were encountered: