2019年4月4日木曜日

Flutter 1.2.1 へのアップグレード (2019.3.31)

Flutter1.2.1 へののアップグレードを行いました。

ちなみに、Flutter の必要とされている環境は以下の通りです。
Flutter.devのサイトから引用しました。

私の環境はMacOS 10.12.6です。

  • OS: macOS (64-bit)
  • Disk Space: 700 MB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these command-line tools being available in your environment.
    • bash
    • curl
    • git 2.x
    • mkdir
    • rm
    • unzip
    • which
  1. Flutterをダウンロードしてきます。
    flutter_macos_v1.2.1-stable.zip
     
  2. ダウンロードしてきたzipファイルを展開します。
    $ cd ~/development
    $ unzip ~/Downloads/flutter_macos_v1.2.1-stable.zip
     
  3. Pathを通しておきます。

    export PATH="$PATH:`pwd`/flutter/bin"

    これは、ターミナルにおける一時的なものなので、
    私の場合は、.bash_profile にパスを通しています。
     
  4. 必要に応じて、開発用バイナリを事前ダウンロードします。
     
  5. flutter doctorを実行します。

    $ flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel beta, v0.11.13, on Mac OS X 10.12.6 16G1815, locale ja-JP)
    [!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
    [!] iOS toolchain - develop for iOS devices (Xcode 9.2)
        ✗ Verify that all connected devices have been paired with this computer in Xcode.
          If all devices have been paired, libimobiledevice and ideviceinstaller may        require updating.
       To update with Brew, run:
           brew update
           brew uninstall --ignore-dependencies libimobiledevice
           brew uninstall --ignore-dependencies usbmuxd
           brew install --HEAD usbmuxd
           brew unlink usbmuxd
           brew link usbmuxd
           brew install --HEAD libimobiledevice
           brew install ideviceinstaller
        ✗ CocoaPods not installed.
            CocoaPods is used to retrieve the iOS platform side's plugin code that          responds to your plugin usage on the Dart side.
            Without resolving iOS dependencies with CocoaPods, plugins will
            work on iOS.
            For more info, see https://flutter.io/platform-plugins
          To install:
            brew install cocoapods
            pod setup
     [✓] Android Studio (version 3.2)
     [!] Connected device
         ! No devices available
     
  6. ✗ が付いているものを指示通りに実行して行きます。
       $ flutter doctor --android-licenses
       1 of 6 SDK package license not accepted.] 100% Computing updates...                 Review license that has not been accepted (y/N)? y

      ----------------- 略 ----------------

      Accept? (y/N): y
      All SDK package licenses accepted

     To relink: brew unlink usbmuxd && brew link usbmuxd
      $ brew unlink usbmuxd && brew link usbmuxd
         Unlinking /usr/local/Cellar/usbmuxd/HEAD-873252d_1... 7 symlinks removed
Linking /usr/local/Cellar/usbmuxd/HEAD-873252d_1... 7 symlinks created

     $ brew install --HEAD libimobiledevice
        Updating Homebrew...
       Warning: libimobiledevice HEAD-0584aa9_3 is already installed and up-to-date

      To reinstall HEAD_3, run `brew reinstall libimobiledevice`

    新しいバージョンのものと置き換えるように指示が表示されているので、
 その指示通りにインストールします。
   
    $ brew reinstall libimobiledevice

    $ brew install ideviceinstaller
       Warning: ideviceinstaller 1.1.0_4 is already installed and up-to-date
       To reinstall 1.1.0_4, run `brew reinstall ideviceinstaller`

    $ brew install cocoapods
    Updating Homebrew...
    Error: cocoapods 1.5.3 is already installed
    To upgrade to 1.6.1, run `brew upgrade cocoapods`

    cocoapodsをアップグレードするようにと指示があるので、その通りにします。

    $ brew upgrade cocoapods
    Updating Homebrew...
    ==> Upgrading 1 outdated package:
    cocoapods 1.5.3 -> 1.6.1

7. flutter doctorを再度走らせます。

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.11.13, on Mac OS X 10.12.6 16G1815, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.2)
[!] Connected device
    ! No devices available

8. Android Studio における設定など

   私の場合は、常々開発を行なっている訳ではないので、Android Studioを
 アップグレードしたのとエミュレータを入れ替えたのみです。

以上となります。