Skip to content

Instantly share code, notes, and snippets.

@raffecat
Last active January 31, 2023 04:38
Show Gist options
  • Save raffecat/90476c55633850928fdb1ac61365caa8 to your computer and use it in GitHub Desktop.
Save raffecat/90476c55633850928fdb1ac61365caa8 to your computer and use it in GitHub Desktop.
Flutter installation on M1 Mac Monterey 12.6.2

Flutter installation on M1 Mac Monterey 12.6.2

There's a process -

  • see https://docs.flutter.dev/get-started/install/macos
    • download flutter zip and unzip in ~/code
    • add flutter/bin to your .zshrc: export PATH="$PATH:$HOME/code/flutter/bin"
    • sudo softwareupdate --install-rosetta --agree-to-license
    • run flutter doctor
    • Install XCode from the App Store. You will need an Apple ID. https://apps.apple.com/us/app/xcode/id497799835
      • Launch XCode from the Dock and accept the License. Then:
      • sudo xcode-select --switch /Applications/Xcode.app
      • sudo xcodebuild -runFirstLaunch
    • Install CocoaPods. See https://guides.cocoapods.org/using/getting-started.html#installation
      • sudo gem install cocoapods
        • flutter REQUIRES the sudo installation (it couldn't find my --user-install)
      • FIX: error installing pod ext/ffi_c
        • Install XCode Command Line Tools VERSION 12 - https://developer.apple.com/download/all/?q=xcode
        • Newer versions than 12 will FAIL - they're missing ruby/config.h
        • sudo xcode-select --switch /Library/Developer/CommandLineTools (make CLI Tools active)
        • We need to make sure VERSION 12 is the only version found:
          • cd /Library/Developer/CommandLineTools/SDKs
          • ls -lF
            • lrwxr-xr-x 1 root wheel 12 31 Jan 14:49 MacOSX.sdk@ -> MacOSX12.sdk
            • drwxr-xr-x 7 root wheel 224 31 Jan 14:36 MacOSX12.3.sdk/
            • lrwxr-xr-x 1 root wheel 14 31 Jan 14:35 MacOSX12.sdk@ -> MacOSX12.3.sdk
          • DELETE ANY OTHER VERSIONS (don't skip this)
            • Ruby and/or Cocoapods have a magical way of finding the latest version installed, so helpful.
        • You might need to DELETE cached files:
          • rm -rf /Library/Ruby/Gems/2.6.0/gems/ffi-*
          • rm -rf /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-*
        • sudo gem install cocoapods
        • sudo xcode-select --switch /Applications/Xcode.app (switch back to full XCode)
        • flutter doctor
    • Install Android Studio from https://developer.android.com/studio/index.html
    • FIX missing jre in Android Studio Electric Eel
      • cd /Applications/Android\ Studio.app/Contents
      • ln -s jbr jre they renamed the directory and broke flutter
    • make a new dummy project in Android Studio
    • flutter doctor --android-licenses ... answer yes
    • flutter doctor everything should be green!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment