May 24, 2021

Getting started with Flutter on Apple M1

This guide covers setting up Flutter on an Apple M1 Mac, including fixing common errors with Android Studio and SDK licensing.

Steps

Step 1: Download Flutter

Get the latest stable release for macOS from the official Flutter install page.

As of writing, this was flutter_macos_2.2.0-stable.zip.

Step 2: Run Flutter Doctor

1
flutter doctor

This will show you what’s missing. Common issues on a fresh install:

  • Android toolchain not found
  • Xcode installation incomplete
  • CocoaPods not installed

Step 3: Install Android Studio

Download from developer.android.com/studio and install it.

Step 4: Install Android Command Line Tools (critical step)

Android Studio does not install the Command Line Tools by default. Without them, flutter doctor --android-licenses throws a NoClassDefFoundError.

To install them:

  1. Open Android Studio
  2. Go to Preferences → Appearance & Behavior → System Settings → Android SDK
  3. Click the SDK Tools tab
  4. Check Android SDK Command-line Tools (latest)
  5. Click Apply and let it install

SDK Tools screenshot

Step 5: Accept Android licenses

1
flutter doctor --android-licenses

Accept all prompts. If Step 4 was done correctly, this runs without errors.

Step 6: Install Xcode

Download Xcode from the Mac App Store or Apple Developer. Then run:

1
2
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

Step 7: Install CocoaPods

1
sudo gem install cocoapods

Step 8: Verify everything is working

1
flutter doctor

All items should show a green checkmark. You’re ready to build.

Getting Started with your first app

Try the official Flutter codelab:
Build your first Flutter app