Closed3
Flutterの環境構築をする

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 16.2)
✗ CocoaPods not installed.
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.96.2)
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 2 categories.
flutter doctor
の実行時にAndroidとXcodeの構築が正常に出来ていないので構築する。

CocoaPodsのインストール
brew install cocoapods
でインストール
brew install cocoapods
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#################################################################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
#################################################################################################################################################################################################################################### 100.0%
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods or specify the `--cask` flag. To silence this message, use the `--formula` flag.
==> Downloading https://ghcr.io/v2/homebrew/core/cocoapods/manifests/1.16.2_1
#################################################################################################################################################################################################################################### 100.0%
==> Fetching cocoapods
==> Downloading https://ghcr.io/v2/homebrew/core/cocoapods/blobs/sha256:c0bd1f8e2bdb31e76d8919d8c5181c5ffacab9aa03b9be9cd77c4fcfdd2f0527
#################################################################################################################################################################################################################################### 100.0%
==> Pouring cocoapods--1.16.2_1.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/cocoapods/1.16.2_1: 2,276 files, 17.8MB
==> Running `brew cleanup cocoapods`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
flutter doctorで確認
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.96.2)
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 1 category.

SDKのインストール
Android studioのSettingsからAdnroid SDKをインストール
Android SDK Command-line Tools(latest)
にチェックを入れる。
Licensesの適応
以下のパスに移動し、androidのlicensesを設定するコマンドを実行する。
cd ~/Library/Android/sdk
flutter doctor --android-licenses
最終確認
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.96.2)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
issuesが全て無くなったので無事に環境構築終了。
このスクラップは2025/01/04にクローズされました