Giter Club home page Giter Club logo

asdf-flutter's Introduction

asdf-flutter Build Status

Flutter plugin for the asdf version manager. This includes both flutter and dart.

Install

asdf plugin-add flutter

Configure

If you have problems with accessing to google, you can set the FLUTTER_STORAGE_BASE_URL environment variable to change it but structure must be same with Google. Default value is https://storage.googleapis.com.

Troubleshooting

VSCode

image

To fix the "Could not find a Flutter SDK" error, you can set the FLUTTER_ROOT environment variable in your .bashrc or .zshrc file:

export FLUTTER_ROOT="$(asdf where flutter)"

Bad CPU type in executable

Because this plugin uses jq you have to enable Rosetta to be able to execute non arm optimized software.

Apple will prompt you to install Rosetta if you open a GUI application but not if you're using the terminal. Thus you have to enable Rosetta manually:

softwareupdate --install-rosetta

asdf-flutter's People

Contributors

b099l3 avatar ciccioska avatar dlanileonardo avatar feng19 avatar github-actions[bot] avatar jdve avatar ken-ty avatar kiesman99 avatar mamoru0217 avatar metdinov avatar oae avatar renovate[bot] avatar ronnnnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asdf-flutter's Issues

VSCode Troubleshooting

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.

No such file or directory

~ > asdf current
flutter         2.5.1-stable    /home/user/.tool-versions

~ > flutter
/home/user/.asdf/installs/flutter/2.5.1-stable/bin/internal/shared.sh: line 229: /home/user/.asdf/installs/flutter/2.5.1-stable/bin/cache/dart-sdk/bin/dart: No such file or directory

~ > l /home/user/.asdf/installs/flutter/2.5.1-stable/bin/cache/dart-sdk/bin/dart
.rwxr-xr-x 38M user users 17 Sep 00:01 /home/user/.asdf/installs/flutter/2.5.1-stable/bin/cache/dart-sdk/bin/dart

Master Channel

Some crazy people (like me) use the "master" channel, to test the linux-desktop and other things that are only available on this channel.
Do you have any predictions of when you will add it or will you not?

asdf: No preset version installed for command dart

When trying to run simply run dart from the command line, I get:

asdf: No preset version installed for command dart
Please install the missing version by running one of the following:

asdf install flutter 1.17.2-stable

or add one of the following in your .tool-versions file:

flutter 1.19.0-4.3.pre-beta
flutter 1.20.0-7.2.pre-beta

To work around, I need to run:
export PATH="$(asdf where flutter)/bin/cache/dart-sdk/bin:$PATH"

Flutter versions starting with a period causing problems

Below is a photo of all the recent versions of flutter that are available to install.

These versions should start with a number one.

Screen Shot 2020-05-22 at 3 29 45 PM

However, because these start with a period the installs are put into hidden folders and asdf cannot detect them as demonstrated below.

Screen Shot 2020-05-22 at 3 31 34 PM

Here is the confirmed hidden folder.

Screen Shot 2020-05-22 at 3 33 28 PM

Is this a problem with the asdf flutter script, something on Google's end, or with asdf as a whole?

Remove channel suffix from version specification

https://github.com/oae/asdf-flutter/blob/b136e675d57c9c083c92902c259e285c7154d8a8/bin/install#L23

There should only be one channel per version at any one time, hence it seems redundant to append the channel to the version then check that matches with user input. This is also is different from the asdf norm, my preference would simply to limit it to comparing version[1:] with the user input.

This means that installing the latest version would change from inputting "1.12.13+hotfix.5-stable" to simply "1.12.13+hotfix.5".

MacOS downloads are zips, not tars

I dunno if things changed with flutter v3, but the MacOS downloads are zip files not tars: https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json

When I run asdf install flutter 3.0.1-stable, for example, I get:

$ asdf install flutter 3.0.1-stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1204M  100 1204M    0     0  34.1M      0  0:00:35  0:00:35 --:--:-- 33.1M
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

Looking for maintainers

I am not using flutter anymore. If someone wants to maintain this, I can give the required permissions.

Support to fvm config json

Motivation

Unfortunately, asdf-vm isn't well known as we wish and usually, people tend to work with the specific language version manager so it's very common to face legacy version files instead of the .tool-versions.

Suggestion

As an asdf heavy user, it would be great if we could experience compatibility with these other version managers when working with legacy_version_files enabled, something similar to what we see on asdf-nodejs handling with .nvmrc or .node-version files.

Straight to the point, I believe it would be great if this plugin was able to handle the version specified on the .fvm/fvm_config.json.

Here's an example of this file:

{
  "flutterSdkVersion": "2.8.1",
  "flavors": {}
}

dart included

my opinion, you should add in the description that this plugin already includes dart and you no needed asdf-dart

and after/before install

Doesn't list the latest flutter version

Hi, when I run asdf list all flutter, the latest stable version available is only up until 2.2.1-stable, while the official latest version is 2.5.0. Can I know how to fix this?

Flutter Shim

This doesn't appear to be a problem with asdf, so, if it is, tell me.

Expected Behavior:
Choose flutter shim for vsocde of vscodium flutter plugin. Use asdf Flutter installation for vscode allowing easy use of shortcuts.

Actual Behavior:
Choosed flutter shim 1.17.1-stable (i believe that's the name) for flutter plugin and 2 results poped up. Flutter shim not in path and the name not being flutter.

I don't think it's possible to have a flutter installation be in bash but one step in the right direction would be to have the version name contain a folder named flutter. Then this would allow you to pass that into vscode and because vscode flutter plugin only allows the name to be flutter for the plugin.

Warn when required dependencies are missing.

Hi!

Thanks for this plugin, it's been working great for me!

However, I was trying to set it up on a new Macbook today and listing versions just failed with No compatible versions available (flutter ). I eventually figured out that this was because I hadn't installed jq but there was no clue at all that this was the problem.

It would be great if there was a warning when required system packages are missing (not sure if there are others apart from jq).

How to install last version?

I've been trying to install Flutter version 1.17.1 with no luck is there anything I have to do to get the last version of Flutter?

Not working on WSL

This plugin isn't working with my instance of Debian (which is really Pengwin, which is Debian, plus a few extra WSL things) on WSL.

What's going on is that I can't really install anything cause $ asdf list all flutter isn't producing any output. Originally, jq was having a permission error because wasn't it allowed to execute (although it's set to here), but I fixed that with chmod 755 ..., but I still get no output from $ asdf list all flutter.

Also, when I try $ asdf install flutter latest, I get back flutter is already installed. When I run $ asdf latest flutter, I get nothing back.

$ uname -m
x86_64
$ uname -s
Linux

Keep getting an error

I've tried installing several versions, and I keep getting:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

Any ideas?

3.0.0 macOS arm64 unable to find url

$ asdf install flutter 3.0.0-stable
/Users/jayjah/.asdf/plugins/flutter/bin/install: line 25: jq: command not found
/Users/jayjah/.asdf/plugins/flutter/bin/install: line 26: jq: command not found
/Users/jayjah/.asdf/plugins/flutter/bin/install: line 27: [: -gt: unary operator expected
Cannot find the download url for the version: 3.0.0-stable

Install error results in inconsistent state

When installing a Flutter version without the xz binary available, it results in an installation failure, but the requested version is also registered as if the installation was successful:

root@337d2c0a2675:~# asdf install flutter 3.16.2-stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  626M  100  626M    0     0  30.8M      0  0:00:20  0:00:20 --:--:-- 33.1M
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

root@337d2c0a2675:~# asdf list flutter
  3
 *3.16
  3.16.1
  3.16.1-stable
  3.16.2-stable

(feature request) Android studio support

Hello!

I use Android Studio's Flutter plugin for developing my flutter projects, which requires a path to the flutter directory. So I need to manually need to reset the path of the Flutter install for switching or upgrading my Android Studio projects.

Can you think of a way to set this based on the project's .local-versions selection for Flutter?

Current and only idea: add some sort of asdf step to keep a symlink to the flutter dir up to date (ln -sfn $(asdf where flutter) flutter_dir) as the asdf version changes.

p.s.
Thanks for the plugin!

Versions malformed?

When I run asdf list all flutter, I see:

.17.0-3.2.pre-beta
.17.0-dev.0.0-dev
.17.0-dev.1.0-dev
.17.0-dev.2.0-dev
.17.0-dev.3.0-dev
.17.0-dev.3.1-beta
.17.0-dev.4.0-dev
.17.0-dev.5.0-dev
.18.0-6.0.pre-dev
.18.0-dev.0.0-dev
.18.0-dev.1.0-dev
.18.0-dev.2.0-dev
.18.0-dev.3.0-dev
.18.0-dev.4.0-dev
.18.0-dev.5.0-dev

(truncated, full list: https://gist.github.com/mrienstra/52e68246ecf15ed02e20b137c5a924d4 )

Notably I do not see any of the 1.17.* or 1.18.* versions, instead I see .17.* or .18.*.

Comparing to https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#beta-channel-macos :

1.17.0-3.2.pre
1.17.0-dev.0.0
1.17.0-dev.1.0
1.17.0-dev.2.0
1.17.0-dev.3.0
1.17.0-dev.3.1
1.17.0-dev.4.0
1.17.0-dev.5.0
1.18.0-6.0.pre
1.18.0-dev.0.0
1.18.0-dev.1.0
1.18.0-dev.2.0
1.18.0-dev.3.0
1.18.0-dev.4.0
1.18.0-dev.5.0

Looks like the initial 1 is being stripped off. Presumably because Flutter recently changed their version number format -- used to always start with a v, but they dropped the v as of 1.17.0.

https://github.com/oae/asdf-flutter/blob/master/bin/list-all#L17
has gsub("^v"; "") but that should only strip the first character if it is a v...

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

None detected


  • Check this box to trigger a request for Renovate to run again on this repository

Not working on Mac M1

When trying to use the Flutter plugin I'm running into issues trying to find and install a version.

Here's some outputs. The plugin can be added to asdf, but it seems like doing anything else with it doesn't work. Is there something that can be done to get this working? Or is it broken for the M1 mac's at this time?

➜  ~ asdf list all flutter
/Users/nolan/.asdf/plugins/flutter/bin/jq: line 1: Not: command not found
➜  ~ asdf plugin-add flutter

Plugin named flutter already added
➜  ~ asdf install flutter 1.22.6
/Users/nolan/.asdf/plugins/flutter/bin/jq: line 1: Not: command not found
Cannot find the download url for the version: 1.22.6
➜  ~ asdf install flutter v-1.22.6
/Users/nolan/.asdf/plugins/flutter/bin/jq: line 1: Not: command not found
Cannot find the download url for the version: v-1.22.6

Update plugin versions

I'm trying to use version 1.16.3 but when I try to install asdf only lists 1.16.3-dev.

What can be done to list updated flutter releases?

image

asdf-flutter does not install aarch64 version of flutter/dart on aarch64 linux

Hello! Thank you for the plugin. I was working on reproducing a weird installation error I ran into when using asdf and flutter in a virtual machine, when I ran into the below error:

my_app on  main [+] is 📦 v1.0.0+1 via 🎯 
❯ asdf install
flutter 3.3.10-stable is already installed

my_app on  main [+] is 📦 v1.0.0+1 via 🎯 
❯ flutter doctor
/home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/internal/shared.sh: line 225: /home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
/home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/internal/shared.sh: line 225: /home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/cache/dart-sdk/bin/dart: Success

Running uname -a:

❯ uname -a
Linux fedora 6.0.15-300.fc37.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Dec 21 18:09:20 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

asdf-flutter gets the correct version on macOS, but it seems to always get the amd version on linux?

my_app on  main [+] is 📦 v1.0.0+1 via 🎯 
❯ cat .tool-versions 
flutter 3.3.10-stable

Listing of available flutter versions not working

Hi, iam already using your wonderful plugin on another MacBook Pro M1 Pro device without problems.

But today i wanted to install asdf with asdf-flutter on an other MacBook Pro M1 Pro and I get

asdf list all flutter
No compatible versions available (flutter )

Installed asdf with brew and asdf-flutter with asdf plugin-add flutter

What i'am doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.