Learn how to set up your development environment to run, build, and deploy Flutter apps for Android devices.

Choose your development platform

#

The instructions on this page are configured to cover setting up Android development on a Windows device.

If you'd like to follow the instructions for a different OS, please select one of the following.

Set up Android tooling

#

With Android Studio, you can run Flutter apps on a physical Android device or an Android Emulator.

If you haven't done so already, install and set up the latest stable version of Android Studio.

  1. Install prerequisites libraries

    If you're developing on Linux, first install the prerequisite collection of 32-bit libraries that Android Studio requires.

  2. Install Android Studio

    If you haven't done so already, install and set up the latest stable version of Android Studio.

    If you already have Android Studio installed, ensure that it's up to date.

  3. Install Android SDK and tools

    1. Launch Android Studio.

    2. Open the SDK Manager settings dialog.

      1. If the Welcome to Android Studio dialog is open, click the More Actions button that follows the New Project and Open buttons, then click SDK Manager from the dropdown menu.

      2. If you have a project open, go to Tools > SDK Manager.

    3. If the SDK Platforms tab is not open, switch to it.

    4. Verify that the first entry with an API Level of 36 has been selected.

      If the Status column displays Update available or Not installed:

      1. Select the checkbox for that entry or row.

      2. Click Apply.

      3. When the Confirm Change dialog displays, click OK.

        The SDK Component Installer dialog displays with a progress indicator.

      4. When the installation finishes, click Finish.

    5. Switch to the SDK Tools tab.

    6. Verify that the following SDK Tools have been selected:

      • Android SDK Build-Tools
      • Android SDK Command-line Tools
      • Android Emulator
      • Android SDK Platform-Tools
    7. If the Status column for any of the preceding tools displays Update available or Not installed:

      1. Select the checkbox for the necessary tools.

      2. Click Apply.

      3. When the Confirm Change dialog displays, click OK.

        The SDK Component Installer dialog displays with a progress indicator.

      4. When the installation finishes, click Finish.

  4. Agree to the Android licenses

    Before you can use Flutter and after you install all prerequisites, agree to the licenses of the Android SDK platform.

    1. Open your preferred terminal.

    2. Run the following command to review and sign the SDK licenses.

      flutter doctor --android-licenses
    3. Read and accept any necessary licenses.

      If you haven't accepted each of the SDK licenses previously, you'll need to review and agree to them before developing for Android.

      Before agreeing to the terms of each license, read each with care.

      Once you've accepted all the necessary licenses successfully, you should see output similar to the following:

      All SDK package licenses accepted.

Set up an Android device

#

You can debug Flutter apps on physical Android devices or by running them on an Android emulator.

To set up your development environment to run a Flutter app on an Android emulator, follow these steps:

  1. Set up your development device

    Enable VM acceleration on your development computer.

  2. Set up a new emulator

    1. Start Android Studio.

    2. Open the Device Manager settings dialog.

      1. If the Welcome to Android Studio dialog is open, click the More Actions button that follows the New Project and Open buttons, then select Virtual Device Manager from the dropdown menu.

      2. If you have a project open, go to Tools > Device Manager.

    3. Click the Create Virtual Device button that appears as a + icon.

      The Virtual Device Configuration dialog displays.

    4. Select either Phone or Tablet under Form Factor.

    5. Select a device definition. You can browse or search for the device.

    6. Click Next.

    7. If the option is provided, select either x86 Images or ARM Images depending on if your development computer is an x64 or Arm64 device.

    8. Select one system image for the Android version you want to emulate.

      1. If the desired image has a Download icon to the left of the system image name, click it.

        The SDK Component Installer dialog displays with a progress indicator.

      2. When the download completes, click Finish.

    9. Click Additional settings in the top tab bar and scroll to Emulated Performance.

    10. From the Graphics acceleration dropdown menu, select an option that mentions Hardware.

      This enables hardware acceleration, improving render performance.

    11. Verify your virtual device configuration. If it is correct, click Finish.

      To learn more about virtual devices, check out Create and manage virtual devices.

  3. Try running the emulator

    In the Device Manager dialog, click the Run icon to the right of your desired virtual device.

    The emulator should start up and display the default canvas for your selected Android OS version and device.

To set up your development environment to run a Flutter app on a physical Android device, follow these steps:

  1. Configure your device

    Enable Developer options and USB debugging on your device as described in Configure on-device developer options.

  2. Enable wireless debugging

    To leverage wireless debugging, enable Wireless debugging on your device as described in Connect to your device using Wi-Fi.

  3. Install platform prerequisites

    If you're developing on Windows, first install the necessary USB driver for your particular device as described in Install OEM USB drivers.

  4. Connect your device

    Plug your device into your computer. If your device prompts you, authorize your computer to access your Android device.

  5. Verify the device connection

    To verify that Flutter recognizes your connected Android device, run flutter devices in your preferred terminal:

    flutter devices

    Your device should be found and show up as a connected device.

Validate your setup

#
  1. Check for toolchain issues

    To check for any issues with your Android development setup, run the flutter doctor command in your preferred terminal:

    flutter doctor

    If you see any errors or tasks to complete under the Android toolchain or Android Studio sections,

    Complete any mentioned tasks and then run flutter doctor again to verify any changes.

  2. Check for Android devices

    To ensure you set up your emulator and/or physical Android device correctly, run flutter emulators and flutter devices in your preferred terminal:

    flutter emulators && flutter devices

    Depending on if you set up an emulator or a device, at least one should output an entry with the platform marked as android.

  3. Troubleshoot setup issues

    If you need help resolving any setup issues, check out Install and setup troubleshooting.

    If you still have issues or questions, reach out on one of the Flutter community channels.

Start developing for Android

#

Congratulations! Now that you've set up Android development for Flutter, you can continue your Flutter learning journey while testing on Android or begin improving integration with Android.