Skip to content

Flutter SDK installed using Snap is not located correctly on Arch Linux #2886

Closed

Description

@DanTup

Activity

  1. added this to the v3.16.0 milestone on Oct 19, 2020
  2. DanTup commented on Oct 19, 2020

    @DanTup
    MemberAuthor

    @MarcusTomlinson I mis-read the code when I posted here - we're already looking in "~/snap/flutter/common/flutter". The issue is that we only do this if we find a file at /snap/flutter/current/flutter.sh:

    if (isLinux && fs.existsSync(flutterSnapScript)) {

    So is the file /snap/flutter/current/flutter.sh in a different place on Arch? If I understand correctly, we're using this simple as a check for "does the user have the Flutter snap installed?" so we know whether it's reasonable to run ~/snap/flutter/common/flutter if it looks like an uninitialised SDK so it'll pass the later checks.

    I wonder how the Android studio extension finds/prioritises SDK path

    In the issue you linked, the project was created with flutter create then opened. In VS Code the same should work - as we should read the .packages file and find the SDK that way. It doesn't help for projects that haven't had the packages restored already though (or in the case where the Snap hasn't been initialised fully).

    We could also probably easily add ~/snap/flutter/common/flutter to the default locations we search for SDKs which would solve this issue if the Snap was initialised, but it wouldn't help the case where it's been installed and not initialised.

  3. MarcusTomlinson commented on Oct 19, 2020

    @MarcusTomlinson
    Contributor

    We could also probably easily add ~/snap/flutter/common/flutter to the default locations we search for SDKs which would solve this issue if the Snap was initialised, but it wouldn't help the case where it's been installed and not initialised.

    Right, this is the way forward I believe. Without snap-specific logic in the extension (which we don't want), we have to assume the snap is initialised externally. I don't think it's a totally unfair assumption. Most people are likely to install flutter and run at least one command before using it elsewhere (such as flutter upgrade or flutter doctor).

  4. DanTup commented on Oct 19, 2020

    @DanTup
    MemberAuthor

    Ok cool, I'll do that then. I'll leave the other logic in for now too (that can handle uninitialised Snap - albeit only for Ubuntu and others that use the same path) since it's fairly simple. The main goal was to not require Snap-specific implementation for each editor, but that doesn't mean we can't have the additional nice functionality here if it might help simplify getting started.

    Thanks!

  5. added a commit that references this issue on Oct 19, 2020
    ae47fc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions