Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asdf-flutter Build Status

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

Dependencies

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.

FVM support

FVM is one of major version manager for Flutter.

asdf uses a .tool-versions file for auto-switching between software versions. To ease migration, you can have it read an existing .fvm/fvm_config.json or .fvmrc file to find out what version of Flutter should be used. To do this, add the following to $HOME/.asdfrc:

legacy_version_file = yes

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

cannot execute binary file: Exec format error on Linux ARM64

The official Linux release tarball ships with an x86-64 dart-sdk bundled under bin/cache/dart-sdk/, regardless of host architecture. On an aarch64 (or riscv64) host this binary cannot run, and the first flutter invocation fails with:

.../bin/internal/shared.sh: line 273:
.../bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error

Note that this error surfaces from Flutter's own bootstrap script, not from the plugin's install step — the install itself reports success. Flutter ships two stamp files (engine-dart-sdk.stamp and flutter_tools.stamp) that match on first run, which causes Flutter's self-heal (update_dart_sdk.sh, the script that would normally detect the host architecture and fetch a matching dart-sdk) to be skipped entirely.

The plugin now works around this by deleting both stamps after extraction on non-x86_64 Linux hosts, so that update_dart_sdk.sh runs on first invocation and fetches the correct dart-sdk (e.g. dart-sdk-linux-arm64.zip). The first flutter command will incur a one-time download (~220 MB) to replace the bundled dart-sdk.

See ADR001: Linux ARM64 Support for the full diagnosis and rationale.

About

flutter plugin for the asdf version manager [maintainer=@ciccioska, @ken-ty, @oae, @ugurcoskn]

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages