Skip to content
This repository was archived by the owner on Apr 6, 2024. It is now read-only.

Flutter Installation SOP

dgbright edited this page Aug 29, 2023 · 2 revisions

To get started with Flutter, follow the detailed installation for Windows OS provided in this wiki here.

Get the Flutter SDK

  1. Download the Flutter SDK For other release channels, and older builds, check out the SDK archive.
  2. Extract the .zip file to a desired installation location (avoid the C:\Program Files directory; prefer %USERPROFILE\flutter). It is about 2GB, so have some space available on the drive of choice.
  3. Update the PATH environmental variable to run Flutter commands from the Windows console. (append ";{installation_location}\flutter\bin" to the %PATH% environmental variable).
  4. Run "flutter doctor" from the console window to see if there are any platform dependencies needed to complete setup This command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform. Once you have installed any missing dependencies, you can run the flutter doctor command again to verify that you’ve set everything up correctly.

image

Android setup

  1. Download and install Android Studio.
  2. Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android. Alternatively, open Android Studio and navigate to "SDK Manager" to manually configure the Android Studio.
  • For latest Android SDK, navigate to Languages & Frameworks > Android SDK. In the SDK Platforms, select "Android API 34"
  • For Android SDK Command-line Tools, Languages & Frameworks > Android SDK. in the SDK Tools, select "Android SDK Command-line Tools (latest)"
  • For Android SDK Build-Tools, Languages & Frameworks > Android SDK. in the SDK Tools, select "Android SDK Build-Tools 34"
  • Once all are selected, select "Apply" and follow any on-screen steps/guides.
  1. Run "flutter doctor" to confirm that the Flutter SDK has located your installation of Android Studio. If Flutter cannot locate it, run flutter config --android-studio-dir=<directory> to set the directory that Android Studio is installed to.

Set up your Android device

To prepare to run and test your Flutter app on an Android device, you need an Android device running Android 4.1 (API level 16) or higher.

  1. Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
  2. [Optional] To leverage wireless debugging, enable Wireless debugging on your device. Detailed instructions are available in the Android documentation.
  3. Windows-only: Install the Google USB Driver.
  4. Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
  5. In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device. By default, Flutter uses the version of the Android SDK where your adb tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_SDK_ROOT environment variable to that installation directory.

Set up the Android emulator

To prepare to run and test your Flutter app on the Android emulator, follow these steps:

  1. Enable VM acceleration on your machine.
  2. Launch Android Studio, click on Device Manager icon, and select Create Device under Virtual tab…
  • In older versions of Android Studio, you should instead launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device…. (The Android submenu is only present when inside an Android project.)
  • If you do not have a project open, you can choose 3-Dot Menu / More Actions > Virtual Device Manager and select Create Device…
  1. Choose a device definition and select Next.
  2. Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
  3. Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware acceleration.
  4. Verify the AVD configuration is correct, and select Finish. For details on the above steps, see Managing AVDs.
  5. In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.

Agree to Android Licenses

To prepare to run and test your Flutter app on the Android emulator, follow these steps:

Before you can use Flutter, you must agree to the licenses of the Android SDK platform. This step should be done after you have installed the tools listed above.

  1. Open an elevated console window and run the following command to begin signing licenses. flutter doctor --android-licenses
  2. Review the terms of each license carefully before agreeing to them.
  3. Once you are done agreeing with licenses, run flutter doctor again to confirm that you are ready to use Flutter.

image

Windows setup

Additional requirements for Windows

For Windows desktop development, a Visual Studio (2019 or 2022) workload is required in addition to the Flutter SDK. Visual Studio 2022 IDE Visual Studio Build Tools 2022 When installing Visual Studio or only the Build Tools, you need the “Desktop development with C++” workload installed for building windows, including all of its default components.

Set up a text editor (VS Code)

Install VS Code

VS Code is a code editor to build and debug apps. With the Flutter extension installed, you can compile, deploy, and debug Flutter apps.

To install the latest version of VS Code, follow Microsoft’s instructions: Install on Windows

Install the VS Code Flutter extension

  1. Start VS Code.
  2. Open a browser and go to the Flutter extension page on the Visual Studio Marketplace.
  3. Click Install. Installing the Flutter extension also installs the Dart extension.

image

Validate your VS Code setup

  1. Go to View > Output. You can also press Control / Command + Shift + U.
  2. In the dropdown on the upper right of the Output panel, select flutter (flutter).
  3. Go to View > Command Palette…. You can also press Control / Command + Shift + P.
  4. Type doctor.
  5. Select the Flutter: Run Flutter Doctor. Flutter Doctor runs and its response displays in the Output panel.