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

[Feature Request] Improve docs for configuration Android Studio #600

Open
deandreamatias opened this issue Feb 12, 2024 · 4 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@deandreamatias
Copy link
Contributor

deandreamatias commented Feb 12, 2024

Is your feature request related to a problem? Please describe.
The currently docs about configuration Android Studio, do not fit with the new setup by FVM 3.0

Describe the solution you'd like
I would like that the documentation will be clear about how configure Android Studio to handle dynamically flutter version with FVM 3.0 setup

Describe alternatives you've considered

  • Update documentation

Additional context
With the currently setup, the flutter version won't be dynamically
Screenshot 2024-02-12 at 10 08 33

@deandreamatias deandreamatias added the enhancement New feature or request label Feb 12, 2024
@leoafarias
Copy link
Owner

@deandreamatias will leave this open, but there was a PR brought over to improve this
#576, will document later

@leoafarias leoafarias self-assigned this Feb 12, 2024
@ManuelRauber
Copy link
Contributor

ManuelRauber commented Feb 21, 2024

@deandreamatias There is the second symlink missing. There should be a flutter_sdk symlink, see

void _updateCurrentSdkReference(Project project, CacheFlutterVersion version) {
final currentSdkLink = join(project.localFvmPath, 'flutter_sdk');
if (currentSdkLink.link.existsSync()) {
currentSdkLink.link.deleteSync();
}
if (!ctx.priviledgedAccess) return;
currentSdkLink.link.createLink(version.directory);
}

And then it works like described in the docs.

@ManuelRauber
Copy link
Contributor

@leoafarias Assign issue to me please, I can fix it in case there is really something not working as expected.

@ManuelRauber
Copy link
Contributor

Ok, I investigated a bit further: flutter/flutter-intellij#6616

Unfortunately, the behavior has changed to resolve symlinks which was not the case, when I did the PR #576.

So, at the moment, it seems that with Android Studio the automatic SDK switch is broken.

Best would be, if the Flutter Plugin supports FVM, see: flutter/flutter-intellij#6289 - which is not likely to happen from the official team.

In .idea/libraries/ are several files with paths to the SDK. Before the current behavior, the IDE wrote a PROJECT_DIR path in it. With the current behavior, it resolves the symlink and writes USER_HOMEDIR paths in it, which breaks the dynamic SDK switch.
FVM could update those paths, but this will likely get overwritten by the IDE anytime, so it will break again.

It looks like puro.dev is doing it: https://github.com/pingbird/puro/blob/146a79d729aff35dc2282bb076047d1e166f1e21/puro/lib/src/workspace/intellij.dart#L75-L160 - so they will have the same issue as soon as the plugin is saving something different/new paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants