Flutter

Install on Windows

In order to have a working minimal developer environment (aka, without Android Studio installed), i have researched quite a bit on available resources, and with try and error approach i managed to get things working with following setup:

  1. Download flutter;

  2. Download the older sdk-tools to ‘D:\Develop\android\sdk’. Could not make it with Command Line Tools latest version (at the time of writing ‘commandlinetools-win-6200805_latest.zip’);

  3. Download Adoptopenjdk 8 (LTS) version to ‘D:\Develop\adoptopenjdk-8’;

  4. Create the following user environment variables:

Environment Variables

Variable

Value

ANDROID_HOME

D:\Develop\android

ANDROID_SDK_ROOT

D:\Develop\android\sdk

FLUTTER_HOME

D:\Develop\flutter

JAVA_HOME

D:\Develop\adoptopenjdk-8

Path

%ANDROID_HOME% %FLUTTER_HOME%\bin %ANDROID_SDK_ROOT% %ANDROID_SDK_ROOT%\bin %JAVA_HOME%\bin

  1. Install VS Code and Flutter/Dart plugins;

  2. Open a command prompt/powershell and check if android sdk tools work:

sdkmanager --list
  1. Run flutter doctor to verify dependecy problems:

flutter doctor -v
  1. Install Android SDK:

sdkmanager --install "build-tools;29.0.3" "emulator" "extras;intel;Hardware_Accelerated_Execution_Manager" "patcher;v4" "platform-tools" "platforms;android-29" "system-images;android-29;default;x86_64" "system-images;android-29;google_apis;x86_64"
  1. Installing Standalone Intel HAXM on Windows:

Open a Command Prompt window with administrator privileges (Run as Administrator) and execute the following command:

sc query intelhaxm

If Intel HAXM is working, the command will show a status message indicating that the state is: “4 RUNNING”.

To stop or start Intel HAXM, use these commands:

Stop:

sc stop intelhaxm

Start:

sc start intelhaxm

Create emulator

avdmanager list
  • Create avd/emulator:

avdmanager create avd --force --name Nexus6P --abi google_apis/x86_64 --package 'system-images;android-29;google_apis;x86_64' --device "Nexus 6P"
  • Lists existing Android Virtual Devices (avd):

avdmanager list avd
  • Run avd/emulator:

emulator @Nexus6P

Working workflow

  1. Start emulator device in VS Code;

  2. Start app:

flutter app

References