Flutter アップデートを行う

Flutter アップデートを行う

Flutteをアップデートをする手順を記述してます。基本的には「flutter upgrade」を実行するだけアップデートできました。Dartもアップデートされます。

環境

  • OS  windows11 pro 64bit
  • Flutter 3.3.7

アップデート

事前に、現行のバージョンを確認しておきます。

> flutter --version

Flutter 3.3.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4f9d92fbbd (9 weeks ago) • 2022-09-06 17:54:53 -0700
Engine • revision 3efdf03e73
Tools • Dart 2.18.0 • DevTools 2.15.0

アップデートを行うには「flutter upgrade」を実行します。

>flutter upgrade

Upgrading Flutter to 3.3.7 from 3.3.1 in C:\flutter...
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 857bd6b74c5eb56151bfafe91e7fa6a82b6fee25...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...

Upgrading engine...
Downloading android-arm-profile/windows-x64 tools...               749ms
Downloading android-arm-release/windows-x64 tools...               475ms
Downloading android-arm64-profile/windows-x64 tools...             258ms
Downloading android-arm64-release/windows-x64 tools...             391ms
Downloading android-x64-profile/windows-x64 tools...               283ms
Downloading android-x64-release/windows-x64 tools...               237ms
Downloading android-x86 tools...                                 1,429ms
Downloading android-x64 tools...                                 1,257ms
Downloading android-arm tools...                                 1,183ms
Downloading android-arm-profile tools...                           717ms
Downloading android-arm-release tools...                           600ms
Downloading android-arm64 tools...                               1,415ms
Downloading android-arm64-profile tools...                         750ms
Downloading android-arm64-release tools...                         505ms
Downloading android-x64-profile tools...                           816ms
Downloading android-x64-release tools...                           668ms
Downloading android-x86-jit-release tools...                       874ms
Downloading Web SDK...                                           2,936ms
Downloading CanvasKit...                                         1,143ms
Downloading package sky_engine...                                  310ms
Downloading flutter_patched_sdk tools...                           471ms
Downloading flutter_patched_sdk_product tools...                   418ms
Downloading windows-x64 tools...                                 2,999ms
Downloading windows-x64/windows-x64-flutter tools...                7.4s
Downloading windows-x64/flutter-cpp-client-wrapper tools...        222ms
Downloading windows-x64-profile/windows-x64-flutter tools...         9.6s
Downloading windows-x64-release/windows-x64-flutter tools...         5.8s
Downloading windows-x64/font-subset tools...                       431ms

Flutter 3.3.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision e99c9c7cd9 (7 days ago) • 2022-11-01 16:59:00 -0700
Engine • revision 857bd6b74c
Tools • Dart 2.18.4 • DevTools 2.15.0

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.7, on Microsoft Windows [Version 10.0.22000.1219], locale ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.4)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.73.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

自分の場合は「issues」が1つあったので、指示通り「flutter doctor –android-licenses」を実行して規約に同意しました。

> flutter doctor --android-licenses

5 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)? y

... かなり長いです。全て「y」を選択しました

最後にバージョンを確認すると「3.3.7」にアップデートされて「Dart」もアップデートされていることが確認できました。

>flutter --version
Flutter 3.3.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision e99c9c7cd9 (7 days ago) • 2022-11-01 16:59:00 -0700
Engine • revision 857bd6b74c
Tools • Dart 2.18.4 • DevTools 2.15.0