1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Flutter】Android StudioでXcodeでエラーが発生した時の対応方法

Last updated at Posted at 2019-10-22

開発環境
⭐️Flutter
(flutter_macos_v1.9.1+hotfix.5-stable)

⭐️Android Studio 3.5.1
⭐️Xcode11.2 beata

FlutterのiPhoneシミュレーション起動できない場合、
「flutter doctor」コマンドで調べた。

flutter doctor
スクリーンショット 2019-10-23 0.32.32.png
Waiting for another flutter command to release the startup lock...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.14.4 18E226, locale ja-JP)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✗] Xcode - develop for iOS and macOS
    ✗ 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
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install:
        sudo gem install cocoapods
[✓] Android Studio (version 3.5)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

まず、Xcodeの新しいバージョンをダウンロードして、インストールしました。
そして、Xcodeをswitchしました。

 sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

次に、cocoapodsのプラグインをインストールする

brew install cocoapods

インストールが終わったら、セットアップする

pod setup

ここで、終わり。

もう一度下記のコマンドで確認しました。

flutter doctor

Xcodeのシミュレータが起動してないので、起動してね。のエラーがでました。
スクリーンショット 2019-10-23 0.35.41.png

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.14.4 18E226, locale ja-JP)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
[✓] Android Studio (version 3.5)
[!] Connected device
    ! No devices available

IOSのシュミレータを選ぶ
スクリーンショット 2019-10-23 0.37.52.png

IOSのシミュレータが起動する
スクリーンショット 2019-10-23 0.43.20.png

もう一度下記のコマンドで確認しました。

flutter doctor
スクリーンショット 2019-10-23 0.44.30.png
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.14.4 18E226, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
[✓] Android Studio (version 3.5)
[✓] Connected device (1 available)

• No issues found!

これで、成功です!

Runで実行したら、正常に、IOSでFlutterが実行できました。
スクリーンショット 2019-10-23 0.45.58.png

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?