FVM으로 Flutter 버전 관리를 할 수 있다
https://fvm.app/documentation/getting-started/installation
Installation – FVM
fvm.app
해당 사이트에서 인스톨을 진행한다
fvm releases
┌───────────────────┬──────────────┬──────────┐
│ Version │ Release Date │ Channel │
├───────────────────┼──────────────┼──────────┤
│ v1.0.0 │ Dec 4, 2018 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.2.1 │ Feb 26, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.5.4-hotfix.2 │ May 7, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.7.8+hotfix.2 │ Jul 8, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.7.8+hotfix.3 │ Jul 9, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.7.8+hotfix.4 │ Jul 24, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.2 │ Sep 22, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.4 │ Oct 1, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.5 │ Oct 17, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.6 │ Oct 23, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.5 │ Dec 11, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.7 │ Jan 27, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.8 │ Feb 11, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.9 │ Apr 17, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.0 │ May 6, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.1 │ May 13, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.2 │ May 28, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.3 │ Jun 4, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.4 │ Jun 18, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.5 │ Jul 1, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.0 │ Aug 5, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.1 │ Aug 6, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.2 │ Aug 13, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.3 │ Sep 2, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.4 │ Sep 15, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.0 │ Oct 1, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.1 │ Oct 8, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.2 │ Oct 16, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.3 │ Oct 30, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.4 │ Nov 13, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.5 │ Dec 10, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.6 │ Jan 25, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.0 │ Mar 3, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.1 │ Mar 4, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.2 │ Mar 12, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.3 │ Mar 19, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.4 │ Apr 2, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.5 │ Apr 16, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.6 │ Apr 30, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.0 │ May 18, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.1 │ May 27, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.2 │ Jun 11, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.3 │ Jul 1, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.0 │ Sep 8, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.1 │ Sep 17, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.2 │ Sep 30, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.3 │ Oct 15, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.8.0 │ Dec 9, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.8.1 │ Dec 16, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.0 │ Feb 3, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.1 │ Feb 10, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.2 │ Feb 19, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.3 │ Mar 3, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.4 │ Mar 28, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.5 │ Apr 18, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.0 │ May 11, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.1 │ May 20, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.2 │ Jun 10, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.3 │ Jun 22, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.4 │ Jul 1, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.5 │ Jul 13, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.0 │ Aug 30, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.1 │ Sep 7, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.2 │ Sep 14, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.3 │ Sep 28, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.4 │ Oct 5, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.5 │ Oct 19, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.6 │ Oct 26, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.7 │ Nov 2, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.8 │ Nov 9, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.9 │ Nov 23, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.10 │ Dec 15, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.0 │ Jan 24, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.1 │ Feb 1, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.2 │ Feb 8, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.3 │ Feb 9, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.4 │ Feb 21, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.5 │ Feb 23, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.6 │ Mar 1, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.7 │ Mar 8, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.8 │ Mar 22, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.9 │ Mar 30, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.10 │ Apr 5, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.11 │ Apr 12, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.12 │ Apr 20, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.0 │ May 10, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.1 │ May 17, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.2 │ May 24, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.3 │ Jun 2, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.4 │ Jun 7, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.5 │ Jun 14, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.6 │ Jul 12, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.0 │ Aug 16, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.1 │ Aug 23, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.2 │ Aug 30, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.3 │ Sep 8, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.3 │ Sep 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.3 │ Sep 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.4 │ Sep 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.5 │ Sep 20, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.6 │ Sep 27, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.7 │ Oct 11, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.8 │ Oct 18, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.9 │ Oct 25, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.0 │ Nov 15, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.1 │ Nov 27, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.2 │ Nov 30, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.3 │ Dec 6, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.4 │ Dec 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.5 │ Dec 20, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.6 │ Jan 10, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.7 │ Jan 11, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.8 │ Jan 17, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.9 │ Jan 25, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.0 │ Feb 15, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.1 │ Feb 21, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.2 │ Feb 28, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.3 │ Mar 8, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.4 │ Mar 21, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.5 │ Mar 28, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.6 │ Apr 17, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.22.0 │ May 13, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.22.1 │ May 22, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.22.2 │ Jun 6, 2024 │ stable ✓ │
└───────────────────┴──────────────┴──────────┘
Channel:
┌─────────┬─────────┬──────────────┐
│ Channel │ Version │ Release Date │
├─────────┼─────────┼──────────────┤
│ stable │ 3.22.2 │ Jun 6, 2024 │
└─────────┴─────────┴──────────────┘
$fvm releases로 버전 확인이 가능하다
원하는 버전을 설치하고 싶을 땐 인스톨 명령어와 버전을 입력한다
$fvm install 3.22.2
Creating local mirror...
Counting objects: [██████████████████████████████████████████████████] 100%
Compressing objects: [██████████████████████████████████████████████████] 100%
Receiving objects: [██████████████████████████████████████████████████] 100%
Resolving deltas: [██████████████████████████████████████████████████] 100%
✓ Clone complete
✓ Flutter SDK: SDK Version : 3.22.2 installed! (4.0s)
dubi@DUBIui-MacBookPro ~ fvm list
Cache directory: /Users/dubi/fvm/versions
Directory Size: 76.74 MB
┌─────────┬─────────┬─────────────────┬──────────────┬──────────────┬────────┬───────┐
│ Version │ Channel │ Flutter Version │ Dart Version │ Release Date │ Global │ Local │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.22.2 │ │ Need setup │ │ │ │ │
└─────────┴─────────┴─────────────────┴──────────────┴──────────────┴────────┴───────┘
내가 진행할 프로젝트에 버전을 적용 시키고 싶을 때 먼저 프로젝트 폴더까지 경로를 입력하여 들어간다
따로 경로를 변경하지 않았다면 디폴트 경로로 들어간다
cd StudioProjects/test_flutter
버전설치
$fvm use 3.22.2
Setting up Flutter SDK: 3.22.2
Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (2 weeks ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3
✓ Flutter SDK: SDK Version : 3.22.2 is setup
You should add the fvm version directory ".fvm/" to .gitignore.
✔ Would you like to do that now? · yes
✓ Added .fvm/ to .gitignore
✓ Dependencies resolved. (11.4s)
✓ Project now uses Flutter SDK : SDK Version : 3.22.2
다른 파일에서도 사용하고 싶다면 글로벌 명령어를 사용한다
여기서 추가적으로 IDE에서 경로 작업을 해주어야 정상 작동한다
저는 안드로이드 스튜디오로 진행했습니다
1. Android Studio -> Settings
2. Languages & Frameworks -> Flutter -> Flutter SDK path 우측 끝 ... 클릭
3. 디폴트 경로인 StudioProjects에서 진행할 프로젝트 찾고 내부 파일로 들어간다
현재 이 상태이지만 숨김파일 보기 단축키로 .fvm을 찾는다
MAC 은 Shift + Command +.
숨김 보기 명령어를 통해 .fvm을 찾고 flutter_sdk 폴더를 지정한 상태로 경로를 선택한다
경로 지정하면 아래 이미지처럼 아까 설치한 버전이 적용된다
버전 변경방법
프로젝트를 진행할 때 서로 버전을 맞추거나 맞춰야하는 경우가 있다 그럴 때 기존의 방법대로 진행하면 된다
fvm install 3.10.5
✓ Flutter SDK: SDK Version : 3.10.5 installed! (5.4s)
┌─────────┬─────────┬─────────────────┬──────────────┬──────────────┬────────┬───────┐
│ Version │ Channel │ Flutter Version │ Dart Version │ Release Date │ Global │ Local │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.22.2 │ stable │ 3.22.2 │ 3.4.3 │ Jun 6, 2024 │ ● │ ● │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.10.5 │ │ Need setup │ │ │ │ │
└─────────┴─────────┴─────────────────┴──────────────┴──────────────┴────────┴───────┘
$fvm use 3.10.5
Setting up Flutter SDK: 3.10.5
Downloading Darwin x64 Dart SDK from Flutter engine 45f6e009110df4f34ec2cf99f63cf73b71b7a420...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 203M 100 203M 0 0 24.0M 0 0:00:08 0:00:08 --:--:-- 30.1M
Building flutter tool...
Resolving dependencies... (1.7s)
Got dependencies.
Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (1 year ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1
✓ Flutter SDK: SDK Version : 3.10.5 is setup
┌─────────────────────────────────────────────────┐
│ ⚠ Flutter SDK does not meet project constraints │
└─────────────────────────────────────────────────┘
SDK Version : 3.10.5 has Dart SDK 3.0.5 does not meet the project constraints of >=3.2.3 <4.0.0.
This could cause unexpected behavior or issues.
✔ Would you like to proceed? · yes
⠹ Resolving dependencies...... (0.2s)
✗ Could not resolve dependencies. (8.5s)
The current Dart SDK version is 3.0.5.
Because test_flutter requires SDK version >=3.2.3 <4.0.0, version solving failed.
The error could indicate incompatible dependencies to the SDK.
✔ Would you like to continue pinning this version anyway? · yes
✓ Project now uses Flutter SDK : SDK Version : 3.10.5
┌─────────┬─────────┬─────────────────┬──────────────┬──────────────┬────────┬───────┐
│ Version │ Channel │ Flutter Version │ Dart Version │ Release Date │ Global │ Local │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.22.2 │ stable │ 3.22.2 │ 3.4.3 │ Jun 6, 2024 │ ● │ │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.10.5 │ stable │ 3.10.5 │ 3.0.5 │ Jun 14, 2023 │ │ ● │
└─────────┴─────────┴─────────────────┴──────────────┴──────────────┴────────┴───────┘
버전이 로컬에만 추가된걸 확인할 수 있다
기존에 했던대로 SDK 경로를 잡아주면 추가한 3.10.5로 변경된 것을 확인할 수 있다