Skip to content

WARNING

Heads-up: Setting up the Flutter toolchain is notoriously unfriendly to developers inside mainland China. If you cannot hop the Great Firewall, you may want to stop here.

Preface

If, like me, you have never touched mobile development—no Java, no SwiftUI, no Uniapp, no React Native, no Flutter—then this walkthrough is tailor-made for you. Let’s push open the door to a brand-new world together.

Before installing Flutter, make sure you already have a Java environment in place.

Windows

Use Domestic Mirrors

Add the following key-value pairs to your system environment variables:

text
PUB_HOSTED_URL = https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL = https://storage.flutter-io.cn

Download the Flutter SDK

  1. Go to the official SDK releases page and pick the build that matches your OS and tooling preferences.

    file

  2. Extract the downloaded zip file to the directory where you plan to install Flutter. Avoid locations that require elevated permissions (for example C:\Program Files\).

  3. Add the bin directory inside the SDK to your environment variables.

Run flutter doctor

Open a terminal and run flutter doctor. If you have not yet installed the Android toolchain, you should see output similar to the following:

file

Next, run flutter doctor --android-licenses to accept the Android licenses.

The message is quite explicit: Android SDK not found, Android Studio not installed, no available emulator. Fortunately, installing Android Studio will take care of all three issues.

Install Android Studio

  1. Head to the Android Studio download page and click the download button in the middle of the page.

    file

  2. In the dialog that appears, agree to the terms and click the download button again.

    file

  3. Launch the installer you just downloaded and click Next.

    file

  4. Make sure Android Virtual Device is checked, then click Next.

    file

  5. Choose the installation location that suits you and click Next.

    file

  6. Click Install.

    file

  7. When the installer finishes, you’ll see the following confirmation. Click Next.

    file

  8. Check Start Android Studio and click Finish to launch the IDE.

    file

Install the Android SDK

  1. On first launch you should see the screen below. We can skip proxy configuration—just click Cancel to proceed directly to the Android SDK setup.

    file

  2. Click Next.

    file

  3. Select the Android SDK versions you wish to install and choose an installation directory, then click Next.

    file

  4. Click Finish to start the installation.

    file

  5. Once the setup completes, the screen should look like the following. Click Finish to reveal Android Studio’s full interface.

    file

Create a Flutter Project

  1. After Android Studio opens, you should see the welcome screen below. Click Create New Flutter Project.

    file

  2. Choose Flutter Application, then click Next.

    file

  3. If you installed the Flutter SDK to a custom directory, select it now. Configure your Flutter workspace, leave everything else as default, and click Next.

    file

  4. Keep the defaults and click Finish to create the project.

    file

  5. In Android Studio, open the File menu (top left) and choose Settings.

    file

  6. On the left, select Plugins. At the top right, switch to the Marketplace tab, search for “flutter”, then click Install next to the Flutter plugin.

    file

  7. Restart Android Studio once the plugin finishes installing.

    file

Create an Emulator

  1. Open the Tools menu and choose AVD Manager.

    file

  2. If you have never created an Android Virtual Device, the screen will look like this. Click Create Virtual Device.

    file

  3. Select the device hardware profile you prefer and click Next.

    file

  4. Pick a system image and click the Download link.

    file

  5. In the new dialog, agree to the terms and click Next to begin downloading.

    file

  6. When the download completes, you’ll see the confirmation below. Click Finish to return to the image list.

    file

  7. Select the image you just downloaded and click Next.

    file

  8. Accept the defaults and click Finish to create the virtual device.

    file

  9. The new emulator now appears in the list—use it to confirm creation succeeded.

    file

Run the Flutter Project

TIP

From this point forward you may encounter all kinds of errors that prevent the app from running. Consult the Flutter Environment Troubleshooting Guide for help.

  1. Use the device selector in the upper-right corner of Android Studio to start the emulator.

    file

  2. Click the Debug button to launch the project.

    file

  3. Check the emulator. If you see the following screen, 🎉 congratulations—the Flutter environment is up and running!

    file

Released under the MIT License.