-
Notifications
You must be signed in to change notification settings - Fork 319
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
Flutter SDK Path resolves symlink #6616
Comments
I spent some time in the debugger to find how the symlinks were handled. The conversion from symlink to directory happens in the IntelliJ UI framework. Unfortunately, we can't change this behavior unless we rewrite the SDK selection code to use some component that does not resolve symlinks (if there is one). The component we currently use is deprecated, so we'll need to change it someday. We'll try to use one that does not resolve symlinks. |
That would be great. Thanks a lot for investigating it, @stevemessick . |
Hello, i have the same problem if i use the file browser. A temporary fix, if u paste the path directly into the input field, the path stays. There is a second problem with fvm and the sdk path. The problem in my opinion is the cacheKey. Projects have a symlink and all projects with the same flutter version have the same canonical path like: fvm/versions/3.10.5. If u set the path for the first project, the key is created and saved the path for this project. But if u go into another project, set the path and the symlink points to the same flutter version, the code produces the same canonical path and will find an entry in the 'projectSdkCache' map and return this entry (first project with the same flutter version). This function is in FlutterSdk.java line 149 actual master branch.
|
@rivella50 Can you try changing the Dart SDK path with a linked path? Is it resolved or remains the same as you entered? |
@AlexV525 As mentioned in my initial post i entered the symlink in the Flutter SDK input field (which then also applies the included Dart version), and this symlink is resolved when i hit the Apply or Ok button. |
What I mean is to set the Dart SDK path with symlinked without toggling Flutter's path. |
That's interesting. When I did a little PR in FVM repo (leoafarias/fvm#576) the IDE did not resolve the symlink. Also, I added code to check that in |
any fix or workaround available for this? |
This bug is crazymaking. |
Any chance of this getting some attention? There are 38 thumbs up (by the time of writing this comment), which is a considerably amount IMO. |
Steps to Reproduce
Please tell us what you were doing and what went wrong
The path shouldn't be resolved since this doesn't allow me to update the Flutter version using FVM in the shell.
The path is resolved which causes me to manually change the Flutter SDK version in the settings as well.
I use FVM for handling different Flutter versions in my ongoing projects. Switching a version works by calling
fvm use VERSION
in the console, where the symlink to the new Flutter version path is changed in.fvm/flutter_sdk
If i remember correctly the absolute path to the symlink could be entered in the mentioned SDK path text field and wasn't resolved when i clicked Apply or Ok in an earlier version of this plugin, which allowed me to only change the Flutter version in the shell which was then recognized and automatically updated in the IDE.
Now this isn't possible anymore since the path to the symlink isn't kept but resolved.
Version info
[✓] Flutter (Channel stable, 3.3.2, on macOS 13.1 22C65 darwin-arm, locale en-CH)
• Flutter version 3.3.2 on channel stable at /Users/valley/fvm/versions/3.3.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e3c29ec00c (5 months ago), 2022-09-14 08:46:55 -0500
• Engine revision a4ff2c53d8
• Dart version 2.18.1
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/valley/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• ANDROID_HOME = /Users/valley/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/valley/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 72.0.4
• Dart plugin version 223.8617.8
[✓] VS Code (version 1.74.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 32) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.1 22C65 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
The text was updated successfully, but these errors were encountered: