Flutter Version Management: A simple CLI to manage Flutter SDK versions.

Last update: Jun 25, 2022

fvm

GitHub stars Pub Version Likes Health Coverage Github All Contributors MIT Licence Awesome Flutter

Flutter Version Management: A simple cli to manage Flutter SDK versions.

FVM helps with the need for a consistent app builds by allowing to reference Flutter SDK version used on a per-project basis. It also allows you to have multiple Flutter versions installed to quickly validate and test upcoming Flutter releases with your apps, without waiting for Flutter installation every time.

Features:

  • Configure and use Flutter SDK version per project
  • Ability to install and cache multiple Flutter SDK Versions
  • Fast switch between Flutter channels & versions
  • Dynamic SDK paths for IDE debugging support.
  • Version FVM config with a project for consistency across teams and CI environments.
  • Set global Flutter version across projects

The app has moved to a different repo and is now Flutter Sidekick.

Read more about it here.

FVM App Screenshot

Version Management

This tool allows you to manage multiple channels and releases, and caches these versions locally, so you don't have to wait for a full setup every time you want to switch versions.

Also, it allows you to grab versions by a specific release, i.e. v1.2.0 or 1.17.0-dev.3.1. In case you have projects in different Flutter SDK versions and do not want to upgrade.

Usage

  1. Install Dart.
  2. Activate Fvm:
> pub global activate fvm

Read dart.dev docs for more info on how to run global dart scripts.

And then, for information on each command:

> fvm help

Install a SDK Version

FVM gives you the ability to install many Flutter releases or channels.

  • version - use stable to install the Stable channel and v1.8.0 or 1.17.0-dev.3.1 to install the release.
  • --skip-setup - will skip Flutter setup after install
> fvm install <version>

Project Config SDK Version

If you configured your project to use a specific version, run install without any arguments will install the proper version.

> fvm install

Check out use command to see how to configure a version per project.

Use a SDK Version

You can use different Flutter SDK versions per project. To do that you have to go into the root of the project and:

> fvm use <version>

Set Global Version

If you want to use a specific version by default in your machine, you can specify the flag --global to the use command. A symbolic link to the Flutter version will be created in the fvm home folder, which you could then add to your PATH environment variable as follows: FVM_HOME/default/bin. Use fvm use --help, this will give you the exact path you need to configure.

⚠️ Do not activate fvm using flutter pub global activate if you plan on using the --global flag. Only activate fvm using pub global activate fvm.

> fvm use <version> --global

Force Flag

Fvm only allows to call the use command on Flutter projects. However if you want to call the use command on a non-flutter directory use the --force flag.

If you are starting a new project and plan on using fvm flutter create you wil have to use the --force flag

> fvm use <version> --force

Remove a SDK Version

Using the remove command will uninstall the SDK version locally, this will impact any projects that depend on that version of the SDK.

> fvm remove <version>

Upgrade the current SDK Version

To upgrade currently used Flutter SDK version (e.g. stable) you should call the Flutter SDK command as you would normally do in case of typical Flutter installation. See more in the section Running Flutter SDK commands.

> fvm flutter upgrade

List Installed Versions

List all the versions that are installed on your machine. This command will also output where FVM stores the SDK versions.

> fvm list

List Flutter Releases

Displays all Flutter releases, including the current version for dev, beta and stable channels.

> fvm releases

Running Flutter SDK commands

There are couple of ways you can interact with the Flutter SDK setup in your project. You can run all the Flutter commands through the fvm proxy commands.

Proxy Commands

The flutter and dart commands within fvm proxy all calls to the CLI just changing the SDK to be the local one.

For instance, to run the flutter run with a given Flutter SDK version just call the following. FVM will recursively try for a version in a parent directory.

> fvm flutter run

This syntax works also for commands with parameters. The following command will call flutter build for a selected flavor and target.

> fvm flutter build aab --release --flavor prod -t lib/main_prod.dart

In other words, calling a fvm flutter xxx command is equivalent to flutter xxx if fvm is available in the directory tree.

Call Local SDK Directly

You can also call the local SDK directly bypassing the proxy commands. FVM creates a symbolic link within your project called fvm which links to the installed version of the SDK.

> .fvm/flutter_sdk/bin/flutter run

The above example is equivalent to flutter run command using the local project SDK.

Change FVM Cache Directory

You are able to configure the fvm cache directory by setting FVM_HOME environment variable. If nothing is set the default fvm path will be used. You are also able to change the directory by setting the --cache-path on the config. See below

FVM Config

There are some configurations which you are able to set on FVM. All settings set on CLI are compatible with the App(GUI).

List config

> fvm config

Set cache path

Location where Flutter SDK versions will be stored. If nothing is set, default will be used.

> fvm config --cache-path <CACHE_PATH>

Flutter Fork & Git Cache

You are able to use your own Flutter fork or cache the Flutter git locally for faster cloning, by setting the FVM_GIT_CACHE environment variable.

Configure Your IDE

In some situations you might have to restart your IDE and the Flutter debugger to make sure it uses the new version.

VSCode

Add the following to your settings.json. This will list all Flutter SDKs installed when using VSCode when using Flutter: Change SDK.

Use fvm list to show you the path to the versions.

List all versions installed by FVM

You can see all the versions installed by FVM in VS Code by just providing path to versions directory:

{
  "dart.flutterSdkPaths": ["/Users/usr/fvm/versions"]
}

Alternatively, you can specify only selected versions. The following snippet will cause VS Code to show only stable and dev versions of Flutter.

{
  "dart.flutterSdkPaths": [
    "/Users/usr/fvm/versions/stable",
    "/Users/usr/fvm/versions/dev"
  ]
}

To change current Flutter version open a project and select Flutter: Change SDK in the command palette. You should see all the versions as depicted in the following screenshot.

VS Code version selector screenshot

You can also add the version symlink for dynamic switch

{
  "dart.flutterSdkPath": ".fvm/flutter_sdk"
}

Remove the flutter sdk from search to make things easier

{
  "search.exclude": {
    "**/.fvm": true
  }
}

Android Studio

Copy the absolute path of fvm symbolic link in your root project directory. Example: /absolute/path-to-your-project/.fvm/flutter_sdk

In the Android Studio menu open Languages & Frameworks -> Flutter or search for Flutter and change Flutter SDK path. Apply the changes. You now can Run and Debug with the selected versions of Flutter. Restart Android Studio to see the new settings applied.

Add your IDE instructions here

Working with this repo

Tests

pub run test

Publishing package

Before pushing package to pub.dev. Run command to create version constant.

pub run build_runner build

Update test coverage

To update test coverage run the following command.

pub run test_coverage

Troubleshooting

  1. On Windows make sure you are running as an administrator
  2. If you get errors with messages invalid kernel binary or invalid sdk hash it means you activated fvm using flutter pub global activate fvm. Only activate fvm using pub global activate fvm.

License

This project is licensed under the MIT License - see the LICENSE file for details

Contributors

Thanks goes to these wonderful people (emoji key):


Leo Farias

📖 🤔 💻 💡 👀 🚧 🚇

Ianko Leite

🤔

Caijinglong

💻 🤔

zmtzawqlp

🐛

Peter Leibiger

💻 🚧 💬

Luca Panteghini

📖

David Martos

💻 ⚠️ 📖

Sven Jacobs

💻

Wolfhard Prell

💻

Jaspreet Singh

🤔 💻

Matias de Andrea

📖

znjameswu

🐛

Dominik Roszkowski

📖 📢

Suguru Kishimoto

🐛

mx1up

🐛 💻

Alexandru Mariuti

💻

Andrea Del Fante

🤔 💻

Pieter van Loon

💻 🤔

Mr Yang

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

GitHub

https://github.com/leoafarias/fvm
Comments
  • 1. [BUG] fvm runs commands twice on [Windows]

    fvm command on Windows runs twice

    On Windows when I run fvm it has for quite a while been running the given command twice:

    Like so:

    > fvm use dev --verbose
    Project now uses Flutter: dev
    Project now uses Flutter: dev
    
    > fvm flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel dev, 1.27.0-8.0.pre, on Microsoft Windows [Version 10.0.19041.804], locale en-US)
    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.3)
    [√] Android Studio (version 4.1.0)
    [√] IntelliJ IDEA Community Edition (version 2020.3)
    [√] VS Code (version 1.53.2)
    [√] Connected device (5 available)
    
    • No issues found!
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel dev, 1.27.0-8.0.pre, on Microsoft Windows [Version 10.0.19041.804], locale en-US)
    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.3)
    [√] Android Studio (version 4.1.0)
    [√] IntelliJ IDEA Community Edition (version 2020.3)
    [√] VS Code (version 1.53.2)
    [√] Connected device (5 available)
    
    • No issues found!
    
    >  fvm version
    1.3.7
    1.3.7
    

    Environment:

    • OS: Windows10
    • Shell: PowerShell 7.1.2
    • FVM: 1.3.7

    Additional context Sorry, not sure with which version of fvm it started happening, but I think I have seen it at least for 2 months. Just never got around to reporting it.

    Everything works, but the commands always running twice is a bit annoying to say the least.

    Reviewed by rydmike at 2021-02-26 13:05
  • 2. [BUG] Can't load Kernel binary: Invalid kernel binary format version.

    Describe the bug I'm getting the following message when running fvm

    Can't load Kernel binary: Invalid kernel binary format version.
    

    To Reproduce Steps to reproduce the behavior: MacOs Catalina 10.15.5

    Reviewed by venil7 at 2020-08-09 08:09
  • 3. [BUG] What is Channel unknown

    I am using fvm to manage flutter sdk , I installed sdk 2.0.6 by fvm. And I when I run fvm releases, It's result is:

    Mar 19 21  │ 2.0.3            
    Apr 2 21   │ 2.0.4            
    Apr 15 21  │ 2.2.0-10.1.pre   
    Apr 15 21  │ 2.2.0-10.1.pre   
    Apr 16 21  │ 2.0.5            
    Apr 27 21  │ 2.3.0-0.1.pre    
    Apr 29 21  │ 2.2.0-10.2.pre   
    Apr 30 21  │ 2.0.6            
    May 10 21  │ 2.2.0-10.3.pre   
    May 10 21  │ 2.3.0-1.0.pre    
    May 18 21  │ 2.2.0            
    May 18 21  │ 2.3.0-12.1.pre   
    --------------------------------------
    May 19 21  │ 2.2.0             beta
    --------------------------------------
    --------------------------------------
    May 27 21  │ 2.2.1             stable
    --------------------------------------
    --------------------------------------
    May 28 21  │ 2.3.0-16.0.pre    dev
    --------------------------------------
    

    Which type of version is stable? for example 2.0.6

    Now when I run fvm flutter doctor I got this:

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel unknown, 2.0.6, on Linux, locale en_US.UTF-8)
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    [✓] Chrome - develop for the web
    [!] Android Studio (not installed)
    [✓] VS Code (version 1.56.2)
    [✓] Connected device (2 available)
    

    ! Doctor found issues in 1 category. What is Channel unknown,?

    I want just install stable version.

    Reviewed by tazik561 at 2021-06-01 16:08
  • 4. [Feature Request] Use a different way to distinguish flutter version to use

    Current way to differentiate flutter version to use is by creating a symlink in the root project directly. Unfortunately this symlink uses absolute path, and it does not make sense to commit it into git repo.

    A solution that comes to mind is like what nodenv uses. It stores the version to use in .node-version file in the root project. This file contains a version string, and contains no path. So it can be commited to git.

    The nodenv package also provides anode executable in ~/.nodenv/shims/node that then calls the requested version node binary.

    Reviewed by rchavik at 2019-12-17 04:08
  • 5. Trying to Build Apk for target main[BUG]

    Running on Windows Android studio 4.1

    my app has 4 mains with different environments for the backend. Problem is that I get this log: C:\Datasruvey\DataSurveyPBS_MobileAPP_v2>fvm list Versions path: C:\Users\afachini\fvm\versions stable v1.12.13+hotfix.9 ✔ 'pub' is not recognized as an internal or external command, operable program or batch file.

    C:\Datasruvey\DataSurveyPBS_MobileAPP_v2>fvm flutter build apk -t lib/main_dev.dart Could not install <v1.12.13+hotfix.9> #0 installWorkflow (package:fvm/src/workflows/install_version.workflow.dart:44:5) #1 FlutterCommand.run (package:fvm/src/commands/flutter_command.dart:30:7) #2 CommandRunner.runCommand (package:args/command_runner.dart:197:13) #3 FvmCommandRunner.run (package:fvm/src/runner.dart:60:14) #4 main (file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/fvm-1.3.8/bin/main.dart:4:3)

    'pub' is not recognized as an internal or external command, operable program or batch file.

    Can you please help me?

    Reviewed by AleFachini at 2021-06-07 20:05
  • 6. Flutter command alias

    Create a helper alias command to link project flutter bin to the flutter command

    fvm alias
    

    This will alias the local project bin to flutter for that terminal session.

    Reviewed by leoafarias at 2020-06-21 09:53
  • 7. "fvm use" doesn't work

    Hi! First, i want say thanks for your initiative!

    So, when i try run the command "fvm use 1.10.7", i get this exception:

    PS C:\projetos\vimob\vimobpoc\app> fvm list
    1.10.14
    1.9.1
    beta
    PS C:\projetos\vimob\vimobpoc\app> fvm use 1.10.14
    Using 1.10.14...
    Unhandled exception:
    type 'List<Object>' is not a subtype of type 'String'
    #0      fvmRunner.<anonymous closure> (package:fvm/fvm.dart:39:45)
    #1      _RootZone.runBinary (dart:async/zone.dart:1384:54)
    #2      _FutureListener.handleError (dart:async/future_impl.dart:151:20)
    #3      Future._propagateToListeners.handleError (dart:async/future_impl.dart:690:47)
    #4      Future._propagateToListeners (dart:async/future_impl.dart:711:24)
    #5      Future._completeError (dart:async/future_impl.dart:530:5)
    #6      _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:36:15)
    #7      CommandRunner.runCommand (package:args/command_runner.dart)
    <asynchronous suspension>
    #8      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
    #9      new Future.sync (dart:async/future.dart:224:31)
    #10     CommandRunner.run (package:args/command_runner.dart:112:14)
    #11     fvmRunner (package:fvm/fvm.dart:35:23)
    <asynchronous suspension>
    #12     main (file:///C:/Users/giuliano.stravini/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/fvm-0.6.5/bin/main.dart:4:9)
    <asynchronous suspension>
    #13     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
    #14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
    Using 1.10.14...
    Unhandled exception:
    type 'List<Object>' is not a subtype of type 'String'
    #0      fvmRunner.<anonymous closure> (package:fvm/fvm.dart:39:45)
    #1      _RootZone.runBinary (dart:async/zone.dart:1384:54)
    #2      _FutureListener.handleError (dart:async/future_impl.dart:151:20)
    #3      Future._propagateToListeners.handleError (dart:async/future_impl.dart:690:47)
    #4      Future._propagateToListeners (dart:async/future_impl.dart:711:24)
    #5      Future._completeError (dart:async/future_impl.dart:530:5)
    #6      _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:36:15)
    #7      CommandRunner.runCommand (package:args/command_runner.dart)
    <asynchronous suspension>
    #8      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
    #9      new Future.sync (dart:async/future.dart:224:31)
    #10     CommandRunner.run (package:args/command_runner.dart:112:14)
    #11     fvmRunner (package:fvm/fvm.dart:35:23)
    <asynchronous suspension>
    #12     main (file:///C:/Users/giuliano.stravini/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/fvm-0.6.5/bin/main.dart:4:9)
    <asynchronous suspension>
    #13     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
    #14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
    

    OS: Windows 10 FVM: 0.6.5.

    ps: Any version, i get this error.

    I did something wrong? Or it's really a bug?

    Reviewed by Giuliano-Stravini at 2019-11-07 16:36
  • 8. [BUG] Unable to `flutter `

    Before creating a bug report please make check the following

    • [x] You have read our FAQ
    • [x] If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
    • [ ] If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
    • [x] Run fvm doctor if possible and add the output to the issue.

    fvm doctor:

    No FVM config found:
    /Users/brandontrautmann/src/mobile/flutter
    Fvm will run the version in your PATH env: /Users/brandontrautmann/fvm/default/bin/flutter
    
    Configured env paths:
    ___________________________________________________
    
    Flutter:
    /Users/brandontrautmann/fvm/default/bin/flutter
    
    Dart:
    /Users/brandontrautmann/fvm/default/bin/dart
    
    FVM_HOME:
    not set
    

    Describe the bug Running flutter <command> e.g flutter pub get fails with the following error:

    Downloading Material fonts...                                      727ms
    Downloading Material fonts...                                      500ms
    Failed to download https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip. Ensure you have network connectivity and then
    try again.
    Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum VF/LGEVR6qaggyU/Ekykeg==,
    but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming that your network
    connection is stable.
    

    To Reproduce

    1. Install fvm 2.2.4 via:
    tap "leoafarias/fvm"
    brew "fvm"
    
    1. Attempt to flutter pub get

    Expected behavior flutter pub get should complete normally.

    Logs

    [  +86 ms] executing: sysctl hw.optional.arm64
    [  +18 ms] Exit code 1 from: sysctl hw.optional.arm64
    [   +1 ms] sysctl: unknown oid 'hw.optional.arm64'
    [   +8 ms] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git -c log.showSignature=false log -n 1 --pretty=format:%H
    [  +10 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
    [        ] 18116933e77adc82f80866c928266a5b4f1ed645
    [        ] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git tag --points-at 18116933e77adc82f80866c928266a5b4f1ed645
    [  +20 ms] Exit code 0 from: git tag --points-at 18116933e77adc82f80866c928266a5b4f1ed645
    [        ] 2.5.3
    [  +12 ms] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git rev-parse --abbrev-ref --symbolic @{u}
    [  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
    [        ] origin/stable
    [        ] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git ls-remote --get-url origin
    [   +9 ms] Exit code 0 from: git ls-remote --get-url origin
    [        ] https://github.com/flutter/flutter.git
    [ +118 ms] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git rev-parse --abbrev-ref HEAD
    [  +13 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
    [        ] stable
    [   +6 ms] executing: sw_vers -productName
    [  +17 ms] Exit code 0 from: sw_vers -productName
    [        ] macOS
    [        ] executing: sw_vers -productVersion
    [  +17 ms] Exit code 0 from: sw_vers -productVersion
    [        ] 11.6
    [        ] executing: sw_vers -buildVersion
    [  +17 ms] Exit code 0 from: sw_vers -buildVersion
    [        ] 20G165
    [  +67 ms] Downloading Material fonts...
    [ +441 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip md5 hash: VF/LGEVR6qaggyU/Ekykeg==
    [ +177 ms] Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum
    VF/LGEVR6qaggyU/Ekykeg==, but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming
    that your network connection is stable.
    [  +14 ms] Downloading Material fonts... (completed in 622ms)
    [        ] Downloading Material fonts...
    [ +293 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip md5 hash: VF/LGEVR6qaggyU/Ekykeg==
    [ +142 ms] Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum
    VF/LGEVR6qaggyU/Ekykeg==, but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming
    that your network connection is stable.
    [   +1 ms] Downloading Material fonts... (completed in 437ms)
    [        ] "flutter get" took 1,107ms.
    [  +17 ms] Failed to download https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip. Ensure you have network connectivity
    and then
               try again.
               Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum
    VF/LGEVR6qaggyU/Ekykeg==,
               but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming that your
    network
               connection is stable.
    [   +3 ms] 
               #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
               #1      ArtifactUpdater._downloadArchive (package:flutter_tools/src/cache.dart:931:11)
               <asynchronous suspension>
               #2      CachedArtifact.update (package:flutter_tools/src/cache.dart:688:5)
               <asynchronous suspension>
               #3      Cache.updateAll (package:flutter_tools/src/cache.dart:557:9)
               <asynchronous suspension>
               #4      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1227:7)
               <asynchronous suspension>
               #5      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
               <asynchronous suspension>
               #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
               <asynchronous suspension>
               #8      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
               <asynchronous suspension>
               #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
               <asynchronous suspension>
               #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
               <asynchronous suspension>
               #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #13     main (package:flutter_tools/executable.dart:92:3)
               <asynchronous suspension>
    

    Desktop (please complete the following information):

    • OS: MacOS 11.6
    • FVM Version: 2.2.4

    Additional context

    • To attempt to isolate this issue to fvm, I pulled down the latest stable flutter SDK and executed pub get doing ~/path/to/flutter/sdk/bin/flutter pub get on the same project. This completed successfully.
    • Additionally, I'm able to curl the URL in the error output just fine:

    curl -I https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip:

    HTTP/1.1 200 OK
    X-GUploader-UploadID: ADPycdtp_XeV9hDpLGvUkNoRwSnZcaDzteO7qg9M2vyILJY9cdWJseO5R1rABZc8GoBvmMVKCuIDIKGGQzmsyX6lgiY
    Expires: Fri, 12 Nov 2021 17:51:02 GMT
    Date: Fri, 12 Nov 2021 16:51:02 GMT
    Last-Modified: Tue, 16 Mar 2021 10:09:53 GMT
    ETag: "545fcb184551eaa6a083253f124ca47a"
    x-goog-generation: 1615889393432810
    x-goog-metageneration: 1
    x-goog-stored-content-encoding: identity
    x-goog-stored-content-length: 2197282
    Content-Type: application/octet-stream
    x-goog-hash: crc32c=D0+64g==
    x-goog-hash: md5=VF/LGEVR6qaggyU/Ekykeg==
    x-goog-storage-class: STANDARD
    Accept-Ranges: bytes
    Content-Length: 2197282
    Access-Control-Allow-Origin: *
    Access-Control-Expose-Headers: Content-Type
    Server: UploadServer
    Age: 3517
    Cache-Control: public, max-age=3600
    Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
    
    Reviewed by btrautmann at 2021-11-12 17:51
  • 9. [BUG] Cannot use melos to execute fvm command concurrently

    Before creating a bug report please make check the following

    • [x] You have read our FAQ
    • [x] If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
    • [x] If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
    • [x] Run fvm doctor if possible and add the output to the issue.

    Describe the bug

    Cannot use melos to execute fvm command concurrently.

    To Reproduce Steps to reproduce the behavior:

    1. Go to terminal, cd to a mono repo with multiple packages (e.g. melos repo)
    2. Run melos exec -- exec fvm flutter
    3. Check output
    4. See error
    [app]:
    [app]: Could not install 2.0.6
    [app]:
    [app]: #0      ensureCacheWorkflow (package:fvm/src/workflows/ensure_cache.workflow.dart:61:5)
    [app]: <asynchronous suspension>
    [app]: #1      FlutterCommand.run (package:fvm/src/commands/flutter_command.dart:30:28)
    [app]: <asynchronous suspension>
    [app]: #2      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
    [app]: <asynchronous suspension>
    [app]: #3      FvmCommandRunner.run (package:fvm/src/runner.dart:73:24)
    [app]: <asynchronous suspension>
    [app]: #4      main (file:///Users/mao/.pub-cache/hosted/pub.dartlang.org/fvm-2.0.4/bin/main.dart:6:8)
    [app]: <asynchronous suspension>
    [app]:
    [app]:
    

    Expected behavior

    No error occurs.

    Logs Please provide the verbose logs by running --verbose after the command.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • FVM Version [e.g. 22] 2.0.4
    • If Windows: Which Powershell are you using?

    Additional context

    I have tried the same command with fvm 2.0.1 and there is no problem.

    Reviewed by lcdsmao at 2021-05-19 09:35
  • 10. [BUG] CI unable to resolve flutter command after successful fvm install

    Before creating a bug report please make check the following

    Describe the bug

    fvm works in interactive shell but fails to find flutter command internally when running on CI

    To Reproduce Steps to reproduce the behavior:

    1. Start a CI job on Gitlab and include the following
    install_flutter:
      stage: pre-build
      script:
        - export PATH="$PATH":"$HOME/.pub-cache/bin"
        - fvm --verbose install 1.20.4
      tags:
        - macos
    
    1. This fails on the CI with this error:
    22Version: 1.20.4 - already installed.
    23Internal Error: Could not finish setting up Flutter sdk
    24#0      flutterSetupWorkflow (package:fvm/src/workflows/flutter_setup.workflow.dart:9:5)
    25<asynchronous suspension>
    26#1      InstallCommand.run (package:fvm/src/commands/install_command.dart:49:13)
    27<asynchronous suspension>
    28#2      CommandRunner.runCommand (package:args/command_runner.dart:197:27)
    29#3      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
    30#4      new Future.sync (dart:async/future.dart:223:31)
    31#5      CommandRunner.run (package:args/command_runner.dart:112:14)
    32#6      fvmRunner (package:fvm/src/runner.dart:34:23)
    33#7      main (file:///Users/build/.pub-cache/hosted/pub.dartlang.org/fvm-1.3.0/bin/main.dart:4:9)
    34#8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
    35#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
    36Unhandled exception:
    37Internal Error: Could not finish setting up Flutter sdk
    38#0      flutterSetupWorkflow (package:fvm/src/workflows/flutter_setup.workflow.dart:9:5)
    39<asynchronous suspension>
    40#1      InstallCommand.run (package:fvm/src/commands/install_command.dart:49:13)
    41<asynchronous suspension>
    42#2      CommandRunner.runCommand (package:args/command_runner.dart:197:27)
    43#3      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
    44#4      new Future.sync (dart:async/future.dart:223:31)
    45#5      CommandRunner.run (package:args/command_runner.dart:112:14)
    46#6      fvmRunner (package:fvm/src/runner.dart:34:23)
    47#7      main (file:///Users/build/.pub-cache/hosted/pub.dartlang.org/fvm-1.3.0/bin/main.dart:4:9)
    48#8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
    49#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
    

    Expected behavior Should behave like in interactive session:

    % fvm install 1.20.4
    Version: 1.20.4 - already installed.
    Flutter 1.20.4 • channel unknown • unknown source
    Framework • revision fba99f6cf9 (3 weeks ago) • 2020-09-14 15:32:52 -0700
    Engine • revision d1bc06f032
    Tools • Dart 2.9.2
    

    Desktop (please complete the following information):

    • OS: [MacOS ]
    • FVM Version [1.3.0] via Homebrew Additional context Add any other context about the problem here.
    Reviewed by ened at 2020-10-08 15:20
  • 11. Guide on proper setup on Windows

    i've just started trying out fvm i followed how to install fvm using the pub global command and i installed it properly but cant do fvm install <version> please what am i doing wrong ..\Pub\Cache\bin is in my environment path image when i run that command, its just creating an empty folder which shows when i run the commands image

    Reviewed by DonnC at 2020-08-25 10:11
  • 12. [BUG] chocolatey install. I can't update Dart because FVM has an earlier version of Dart as a dependency.

    Before creating a bug report please make check the following

    • [x] You have read our FAQ
    • [x] If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again. No need
    • [x] If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
    • [x] Run fvm doctor if possible and add the output to the issue. No need

    Describe the bug If I have the latest version of Dart, installing FVM removes that version and puts an older one. If I try to install the new version later, it gives me a dependency error on FVM.

    To Reproduce In Windows 11.

    1. Open powershell
    2. Install chocolatey
    3. Choco: Install dart, latest version
    4. Choco: Install fvm
    5. Choco: upgrade dart

    Expected behavior A clear and concise description of what you expected to happen.

    Logs Captura de pantalla 2022-06-08 235059 chocolatey.log

    Desktop (please complete the following information):

    • OS: Windows 11
    • FVM Version 2.3.1
    • If Windows: Which Powershell are you using? yes

    Additional context In the ChocolateyInstall.ps1 file I see that the version of dart 2.16.2 is indicated Captura de pantalla 2022-06-09 000007

    Reviewed by isdabenx at 2022-06-08 22:00
  • 13. Setting Android Studio As Custom IDE Not Working

    While Trying to set Android studio as a custom ide in mac os is not working. After setting the android studio, going back to the project clicking the open custom it just open the finder app to the location but android studio don't open.

    Reviewed by rahat14 at 2022-06-08 20:08
  • 14. [BUG] The method '[]' was called on null on 'dependencies'

    Before creating a bug report please make check the following

    • [ ] You have read our FAQ
    • [x] If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
    • [-] If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
    • [x] Run fvm doctor if possible and add the output to the issue.

    Describe the bug A clear and concise description of what the bug is.

    Several commands, for example flutter use in a flutter project directory caused. I checked several times I'm in a directory that contains the pubspec.yaml

    Unhandled exception:
    NoSuchMethodError: The method '[]' was called on null.
    Receiver: null
    Tried calling: []("dependencies")
    #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
    #1      ProjectService.isFlutterProject (package:fvm/src/services/project_service.dart:107:33)
    <asynchronous suspension>
    #2      ProjectService.getByDirectory (package:fvm/src/services/project_service.dart:24:25)
    <asynchronous suspension>
    #3      ProjectService.findAncestor (package:fvm/src/services/project_service.dart:125:21)
    <asynchronous suspension>
    #4      ProjectService.findAncestor (package:fvm/src/services/project_service.dart:137:12)
    <asynchronous suspension>
    #5      ProjectService.updateLink (package:fvm/src/services/project_service.dart:36:21)
    <asynchronous suspension>
    #6      ensureCacheWorkflow (package:fvm/src/workflows/ensure_cache.workflow.dart:28:7)
    <asynchronous suspension>
    #7      useVersionWorkflow (package:fvm/src/workflows/use_version.workflow.dart:26:3)
    <asynchronous suspension>
    #8      UseCommand.run (package:fvm/src/commands/use_command.dart:88:5)
    <asynchronous suspension>
    #9      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
    <asynchronous suspension>
    #10     FvmCommandRunner.run (package:fvm/src/runner.dart:72:24)
    <asynchronous suspension>
    #11     main (file:///home/user/.pub-cache/hosted/pub.dartlang.org/fvm-2.1.0/bin/main.dart:6:8)
    <asynchronous suspension>
    

    To Reproduce Steps to reproduce the behavior:

    1. Go to terminal..
    2. Run fvm use stable...
    3. Check...
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Logs Please provide the verbose logs by running --verbose after the command.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • FVM Version [e.g. 22]
    • If Windows: Which Powershell are you using?

    Additional context Add any other context about the problem here.

    I tried older versions because I haven't worked with Dart since quite some time and just updated everything before starting a new project. I tried several versions without success until I got back as far as 2.0.0. With this version fvm use stable succeeded. After that it also succeeded with every newer version.

    So you can just close this issue. I just thought it might be helpful for others looking for the error message.

    Reviewed by zoechi at 2022-06-08 10:16
  • 15. [Question] - How can i execute pub packages activates

    I need to run flutterfire commands to configure my project, and for that I need to run flutterfire.

    Tried running "fvm dart pub global run flutterfire_cli:flutterfire configure"

    But the console gets broken and I can't select the project.

    How can I run flutterfire configure by FVM?

    Thanks.

    Reviewed by rodrigorahman at 2022-05-30 19:40
  • 16. fix: updated android studio configuration docs

    Updated docs for configuration of Android Studio so the Flutter SDK directory is not indexed and shows up in search results. See https://github.com/fluttertools/fvm/issues/354#issuecomment-1135988562

    Reviewed by Giuspepe at 2022-05-27 13:56

Related

A CLI for syncing Dart dependency versions between pubspec.yaml and pubspec.lock files.

lockpick A CLI for syncing Dart dependency versions between pubspec.yaml and pubspec.lock files. ?? Usage # Activate lockpick pub global activate lock

Apr 8, 2022
CLI utility to manage MC Server installations

CLI utility to manage MC server installations. Features Install required JDKs Download server files Generate start scripts (with optimized JVM flags)

Jun 21, 2022
The Dart code generator for your package versions. 🎯
The Dart code generator for your package versions. 🎯

The Dart code generator for your package versions. There is no way to get the package version from the code in the Dart ecosystem. Installation Add bu

Jan 10, 2022
A simple shortcut, command line interface (CLI) for a lazy (a.k.a effective) Flutter developer in order to increase productivity and happiness.

f A simple shortcut, command line interface (CLI) for a lazy (a.k.a effective) Flutter developer in order to increase productivity and happiness. Inst

Jun 20, 2022
Simple CLI tool to produce icons for your next app.

icon_set_generator Simple CLI tool to enable easy production of icon sets for your next application. Installation Clone the repo and add bin/icon_set_

Nov 17, 2021
Converts SVG icons to OTF font and generates Flutter-compatible class. Provides an API and a CLI tool.

Fontify The Fontify package provides an easy way to convert SVG icons to OpenType font and generate Flutter-compatible class that contains identifiers

May 1, 2022
A cli tool to run Flutter applications and auto hot reload it when files are changed

Dashmon A minimalistic CLI tool to run Flutter applications and auto hot reload it when files are changed. It will watch changes your application code

Jun 2, 2022
A CLI tool to help generate dart classes from json returned from API

Json 2 Dart Command line utility Important note There is already a package called json2dart so this package will be called json2dartc ! This project w

May 23, 2022
Command-line Interface (CLI) for any_icon_maker.

makeanyicon Command-line Interface (CLI) for any_icon_maker. makeanyicon Quick Start Installation Usage License Quick Start Installation dart pub glob

Apr 9, 2022
A CLI tool to help batch renaming files.

batch_rename A CLI tool to enable batch renaming of files. Installation Clone the repo and add bin/batch_rename.exe to PATH: gh repo clone POWRFULCOW8

Nov 3, 2021
Official CLI for the GetX framework

Official CLI for the GetX framework

Nov 23, 2021
🔍 👀 CLI utility to check last-visit of your CodeForces friends & much more, 🚀 powered by CodeForces API

JoJo ?? ?? CLI utility to check last-visit of your CodeForces friends & much more, ?? powered by CodeForces API Features Online Friends All Friends Pr

Jul 20, 2020
Feb 2, 2022
Dart language version of Persian-Tools
Dart language version of Persian-Tools

Persian tools Persian Tools dart package which you can use in all platforms Features Adding ordinal suffixes Converting Persian words to number Conver

May 30, 2022
Command-line tool to provide null-safety percentage info of a project. Track your migration progress on mixed-version programs that execute with unsound null safety.

null_safety_percentage Command-line tool to provide null-safety percentage info of a project. Track your migration progress on mixed-version programs

Mar 27, 2022
An extension to the Flutter SDK for building Flutter applications for Tizen devices.
An extension to the Flutter SDK for building Flutter applications for Tizen devices.

Flutter for Tizen An extension to the Flutter SDK for building Flutter applications for Tizen devices. Flutter and the related logo are trademarks of

Jun 22, 2022
Sentry SDK for Dart and Flutter
Sentry SDK for Dart and Flutter

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoy

Jul 1, 2022
Reference implementation for the Zenon SDK for Dart and Flutter apps compatible

Zenon Dart SDK Reference implementation for the Zenon SDK for Dart and Flutter apps compatible with the Zenon Alphanet - Network of Momentum Phase 0.

Apr 21, 2022
A tool to easily install the Android SDK command-line and platform tools.

gibadb A tool to easily install the Android SDK command-line and platform tools. For developers: This README describes the CLI tool that ships with th

Mar 11, 2022