$ ./bin/flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.3, on macOS 11.6 20G165 darwin-x64, locale ja-JP) [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location.
[✗] 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 sudo xcodebuild -runFirstLaunch ✗ 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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web [!] Android Studio (not installed) [✓] VS Code (version 1.65.0) [!] Proxy Configuration ! NO_PROXY does not contain 127.0.0.1 ! NO_PROXY does not contain ::1 [✓] Connected device (1 available) [✓] HTTP Host Availability
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree
You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf
状況確認
Xcodeがインストールできたので、再度flutter doctorで確認します。
1 2 3 4 5 6 7 8 9 10 11
$ flutter doctor ...(省略)... [!] Xcode - develop for iOS and macOS (Xcode 13.2.1) ✗ 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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. ...(省略)...
冒頭にYou can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing.とあるので、グローバルにインストールされているRubyを利用しようと思います。
1 2 3 4 5 6 7 8
$ which ruby /Users/user/.anyenv/envs/rbenv/shims/ruby $ ruby -v ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20] $ rbenv versions * system 2.4.10 3.1.0
$ sudo /usr/bin/gem install cocoapods Password: Fetching concurrent-ruby-1.1.9.gem Fetching tzinfo-2.0.4.gem Fetching zeitwerk-2.5.4.gem Fetching activesupport-6.1.5.gem Fetching fuzzy_match-2.0.4.gem Fetching i18n-1.10.0.gem Fetching nap-1.1.0.gem Fetching httpclient-2.8.3.gem Fetching algoliasearch-1.27.5.gem Fetching ffi-1.15.5.gem Fetching ethon-0.15.0.gem Fetching typhoeus-1.4.0.gem Fetching netrc-0.11.0.gem Fetching public_suffix-4.0.6.gem Fetching addressable-2.8.0.gem Fetching cocoapods-core-1.11.3.gem Fetching claide-1.1.0.gem Fetching cocoapods-deintegrate-1.0.5.gem Fetching cocoapods-downloader-1.5.1.gem Fetching cocoapods-plugins-1.0.0.gem Fetching cocoapods-search-1.0.1.gem Fetching cocoapods-trunk-1.6.0.gem Fetching cocoapods-try-1.2.0.gem Fetching molinillo-0.8.0.gem Fetching atomos-0.1.3.gem Fetching colored2-3.1.2.gem Fetching nanaimo-0.3.0.gem Fetching rexml-3.2.5.gem Fetching xcodeproj-1.21.0.gem Fetching escape-0.0.4.gem Fetching fourflusher-2.3.1.gem Fetching gh_inspector-1.1.3.gem Fetching ruby-macho-2.5.1.gem Fetching cocoapods-1.11.3.gem Successfully installed concurrent-ruby-1.1.9 Successfully installed i18n-1.10.0 Successfully installed tzinfo-2.0.4 Successfully installed zeitwerk-2.5.4 Successfully installed activesupport-6.1.5 Successfully installed nap-1.1.0 Successfully installed fuzzy_match-2.0.4 Successfully installed httpclient-2.8.3 A new major version is available for Algolia! Please now use the https://rubygems.org/gems/algolia gem to get the latest features. Successfully installed algoliasearch-1.27.5 Building native extensions. This could take a while... ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220317-44199-1ctmdly.rb extconf.rb checking for ffi.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) --with-ffi_c-dir --without-ffi_c-dir --with-ffi_c-include --without-ffi_c-include=${ffi_c-dir}/include --with-ffi_c-lib --without-ffi_c-lib=${ffi_c-dir}/lib --enable-system-libffi --disable-system-libffi --with-libffi-config --without-libffi-config --with-pkg-config --without-pkg-config /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header' from extconf.rb:10:in `system_libffi_usable?' from extconf.rb:42:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5 for inspection. Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/gem_make.out
$ brew install libffi Running `brew update --preinstall`... ...(省略)... ==> Downloading https://ghcr.io/v2/homebrew/core/libffi/manifests/3.4.2 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/libffi/blobs/sha256:a461f6ad21a23a725691385dbbec3eff958cf61d5282e84dc3f0483e307e1875 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a461f6ad21a23a725691385dbbec3eff958cf61d5282e84dc3f0483e307e1875?se=202 ######################################################################## 100.0% ==> Pouring libffi--3.4.2.big_sur.bottle.tar.gz ==> Caveats libffi is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble.
For compilers to find libffi you may need to set: export LDFLAGS="-L/usr/local/opt/libffi/lib" export CPPFLAGS="-I/usr/local/opt/libffi/include"
==> Summary 🍺 /usr/local/Cellar/libffi/3.4.2: 17 files, 599.8KB ==> `brew cleanup` has not been run in the last 30 days, running now... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). Removing: /Users/user/Library/Caches/Homebrew/icu4c--69.1... (27.2MB) Removing: /Users/user/Library/Caches/Homebrew/nkf--2.1.5... (167KB) Removing: /Users/user/Library/Caches/Homebrew/nkf_bottle_manifest--2.1.5... (7.9KB) Removing: /Users/user/Library/Logs/Homebrew/telnet... (64B)
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby $ sudo ln -sf ../../../../Headers/ruby/config.h
すると、内容は変わったのですが、いまだにエラーは出ます。
1 2 3 4 5 6 7 8
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c make "DESTDIR=" make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin20/ruby/config.h', needed by `AbstractMemory.o'. Stop.
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5 for inspection. Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/gem_make.out
$ sudo gem install cocoapods Password: Building native extensions. This could take a while... Successfully installed ffi-1.15.5 Successfully installed ethon-0.15.0 Successfully installed typhoeus-1.4.0 Successfully installed netrc-0.11.0 Successfully installed public_suffix-4.0.6 Successfully installed addressable-2.8.0 Successfully installed cocoapods-core-1.11.3 Successfully installed claide-1.1.0 Successfully installed cocoapods-deintegrate-1.0.5 Successfully installed cocoapods-downloader-1.5.1 Successfully installed cocoapods-plugins-1.0.0 Successfully installed cocoapods-search-1.0.1 Successfully installed cocoapods-trunk-1.6.0 Successfully installed cocoapods-try-1.2.0 Successfully installed molinillo-0.8.0 Successfully installed atomos-0.1.3 Successfully installed colored2-3.1.2 Successfully installed nanaimo-0.3.0 Successfully installed rexml-3.2.5 Successfully installed xcodeproj-1.21.0 Successfully installed escape-0.0.4 Successfully installed fourflusher-2.3.1 Successfully installed gh_inspector-1.1.3 Successfully installed ruby-macho-2.5.1 Successfully installed cocoapods-1.11.3 Parsing documentation for ffi-1.15.5 Installing ri documentation for ffi-1.15.5 Parsing documentation for ethon-0.15.0 Installing ri documentation for ethon-0.15.0 Parsing documentation for typhoeus-1.4.0 Installing ri documentation for typhoeus-1.4.0 Parsing documentation for netrc-0.11.0 Installing ri documentation for netrc-0.11.0 Parsing documentation for public_suffix-4.0.6 Installing ri documentation for public_suffix-4.0.6 Parsing documentation for addressable-2.8.0 Installing ri documentation for addressable-2.8.0 Parsing documentation for cocoapods-core-1.11.3 Installing ri documentation for cocoapods-core-1.11.3 Parsing documentation for claide-1.1.0 Installing ri documentation for claide-1.1.0 Parsing documentation for cocoapods-deintegrate-1.0.5 Installing ri documentation for cocoapods-deintegrate-1.0.5 Parsing documentation for cocoapods-downloader-1.5.1 Installing ri documentation for cocoapods-downloader-1.5.1 Parsing documentation for cocoapods-plugins-1.0.0 Installing ri documentation for cocoapods-plugins-1.0.0 Parsing documentation for cocoapods-search-1.0.1 Installing ri documentation for cocoapods-search-1.0.1 Parsing documentation for cocoapods-trunk-1.6.0 Installing ri documentation for cocoapods-trunk-1.6.0 Parsing documentation for cocoapods-try-1.2.0 Installing ri documentation for cocoapods-try-1.2.0 Parsing documentation for molinillo-0.8.0 Installing ri documentation for molinillo-0.8.0 Parsing documentation for atomos-0.1.3 Installing ri documentation for atomos-0.1.3 Parsing documentation for colored2-3.1.2 Installing ri documentation for colored2-3.1.2 Parsing documentation for nanaimo-0.3.0 Installing ri documentation for nanaimo-0.3.0 Parsing documentation for rexml-3.2.5 Installing ri documentation for rexml-3.2.5 Parsing documentation for xcodeproj-1.21.0 Installing ri documentation for xcodeproj-1.21.0 Parsing documentation for escape-0.0.4 Installing ri documentation for escape-0.0.4 Parsing documentation for fourflusher-2.3.1 Installing ri documentation for fourflusher-2.3.1 Parsing documentation for gh_inspector-1.1.3 Installing ri documentation for gh_inspector-1.1.3 Parsing documentation for ruby-macho-2.5.1 Installing ri documentation for ruby-macho-2.5.1 Parsing documentation for cocoapods-1.11.3 Installing ri documentation for cocoapods-1.11.3 Done installing documentation for ffi, ethon, typhoeus, netrc, public_suffix, addressable, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-trunk, cocoapods-try, molinillo, atomos, colored2, nanaimo, rexml, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 26 seconds 25 gems installed
無事インストールできました。
flutter doctorで確認します。
1 2 3 4
$ ./bin/flutter doctor ...(省略)... [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) ...(省略)...
インストールが終わったら、On first launch it will assist you in installing the Android SDK components.と書かれているので、Android Studioを起動します。
利用規約に同意してその他のコンポーネントをインストールします。
ここまで終わったらflutter doctorで確認します。
1 2 3 4 5 6 7 8 9 10 11
$ ./bin/flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.3, on macOS 11.6.4 20G417 darwin-x64, locale ja-JP) [!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) ✗ 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/docs/get-started/install/macos#android-setup for more details. ...(省略)...
$ ./bin/flutter doctor --android-licenses Warning: Failed to download any source lists! Fetch remote repository... Warning: Still waiting for package manifests to be fetched remotely. Warning: Still waiting for package manifests to be fetched remotely.y... Warning: Still waiting for package manifests to be fetched remotely.y... Warning: Still waiting for package manifests to be fetched remotely.y... Warning: Still waiting for package manifests to be fetched remotely.y... Warning: Still waiting for package manifests to be fetched remotely.y... Warning: Still waiting for package manifests to be fetched remotely.y... Warning: IO exception while downloading manifesttch remote repository... Warning: IO exception while downloading manifest Warning: Still waiting for package manifests to be fetched remotely.y... All SDK package licenses accepted.======] 100% Computing updates...
$ ./bin/flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.3, on macOS 11.6.4 20G417 darwin-x64, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.65.2) [!] Proxy Configuration ! NO_PROXY does not contain 127.0.0.1 ! NO_PROXY does not contain ::1 [✓] Connected device (1 available) [!] HTTP Host Availability ✗ HTTP host https://maven.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out ✗ HTTP host https://pub.dev/ is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out ✗ HTTP host https://cloud.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out
$ ./bin/flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.3, on macOS 11.6.4 20G417 darwin-x64, locale ja-JP) [!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.65.2) [✓] Connected device (1 available) [✓] HTTP Host Availability
$ ./bin/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
1/5: License android-googletv-license: ...(省略)...
ライセンスが表示されるのでyを押して同意します。
今度こそ最後にflutter doctorで確認します。
1 2 3 4 5 6 7 8 9 10 11 12
$ ./bin/flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.3, on macOS 11.6.4 20G417 darwin-x64, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.65.2) [✓] Connected device (1 available) [✓] HTTP Host Availability