LoginSignup
25
19

More than 5 years have passed since last update.

Flutter環境構築メモ

Last updated at Posted at 2019-01-06

環境情報

Flutter:1.0.0

SDKのダウンロード

Flutter公式サイトからSDKをダウンロードできます。

flutter doctorの実行結果

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, 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 installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with
      Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install with Brew:
        brew install ios-deploy
    ✗ 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 not work
        on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup
[✓] Android Studio (version 3.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)

! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licensesと書いてあるのでflutter doctor --android-licensesを実行。
出てくる質問に全てyで回答すれば完了。

[✗] iOS toolchain - develop for iOS devices

✗ Xcode installation is incomplete; a full installation is necessary for iOS

Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store.と記載されているので今回はApp Storeからダウンロード。
Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developerと記載されているのでsudo xcode-select --switch /Applications/Xcode.app/Contents/Developerを実行。
ここで再度flutter doctorを実行、下記エラーが発生。

Error executing simctl: 69
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo
xcodebuild -license” and then retry this command.

Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo
xcodebuild -license” and then retry this command.
と記載されているのでsudo
xcodebuild -license
を実行。
ライセンス内容を読み終えた際に表示される質問にagreeと入力。

ここで再度flutter doctorを実行、xcodebuildからソフトウェアインストールを促されるためインストール。(ある程度の待ち時間あり。)
インストールが完了しflutter doctorの実行結果が表示されれば完了。

✗ libimobiledevice and ideviceinstaller are not installed.

記載されている下記コマンドを上から順に実行。

brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
  1. brew updateを実行、特に問題なし。
  2. brew install --HEAD usbmuxdを実行、インストール済みという警告が表示される。
  3. brew link usbmuxdを実行、リンク済みという警告が表示される。
  4. brew install --HEAD libimobiledeviceを実行、インストール済みという警告が表示される。
  5. brew install ideviceinstallerを実行、インストール済みという警告が表示される。

完了。

✗ ios-deploy not installed.

To install with Brew: brew install ios-deployと記載されているためbrew install ios-deployを実行で完了。

✗ CocoaPods not installed.

記載されている下記コマンドを上から順に実行。

brew install cocoapods
pod setup
  1. brew install cocoapodsを実行、特に問題なし。
  2. pod setupを実行、Setup completedと表示される。

[✓] Android Studio (version 3.3)

※[✓] Android Studio (version 3.1)も同様です。

✗ Flutter plugin not installed; this adds Flutter specific functionality.

※✗ Dart plugin not installed; this adds Dart specific functionality.もこの項目で解消されます。
Android Studio起動→ToolbarのAndroid Studioクリック→Preferences→Plugins→Browse repositories→flutterで検索&インストール
これでFlutterとDartのプラグインがインストールされます。

[!] Connected device

端末をPCに接続した状態でflutter doctorを実行すれば完了。

25
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
19