Install Flutter SDK on windows without Android Studio(2021)

preview1.jpg As a college student, I thought of getting started with Android Development and I started a journey to find a way to install Flutter SDK without using or installing Android Studio, as Android Studio takes a lot of RAM, and the setup took me two days to complete, hence the following lesson comes into existence.

All the commands in this tutorial are executed using the windows command prompt, just run it from the Start menu, or hit "windows-key"+ R then type cmd.

Create a working directory

To keep everything in a single place we will consider the dir C:\Android as the main working directory

cd C:\
mkdir Android
cd Android

Installing OpenJDK 8

Download the OpenJDK 8 ZIP from the here. Extract it and rename the internal folder “jdk8u272-b10” to “openjdk” and copy it under “C:\Android” folder, so its path will be:

C:\Android\openjdk

Installing Flutter SDK

Download flutter SDK the latest version from the following link: Extract it, and copy the folder with the name flutter to C:\Android folder, so the full path will be:

C:\Android\flutter

Installing Android command tools

Download Windows version of Android command tools from the following link: extract it and rename the tools folder to cmdline-tools, then copy it under C:\Android folder, so the full path will be:

C:\Android\cmdline-tools

Set Some Environment variables

we need to define some Environment variable which let the above tools know how to contact each other, form command prompt run these commands, one by one:

setx JAVA_HOME “C:\Android\openjdk”
setx ANDROID_HOME “C:\Android”
setx ANDROID_SDK_ROOT “C:\Android\cmdline-tools”
setx path “%path%;”C:\Android\cmdline-tools;C:\Android\cmdline-tools\bin;C:\Android\flutter\bin”

Download and Setup Gradle

Download gradle binary-only file from the following link: Extract it, and copy the folder with the name gradle to C:\Android folder, so the full path will be:

C:\Android\gradle

Define Environment for gradle using the following command in the command prompt:

setx path “%path%;"C:\Android\gradle\bin";

Download Android SDK

As you may already know the Flutter are based on Android SDK to work, so we need to download system images, platform tools, build tools, platforms, and emulator, by running the following commands one by one:

cd C:\Android\cmdline-tools\tools\bin
sdkmanager “system-images;android-29;default;x86_64sdkmanager “platform-tools”
sdkmanager “build-tools;29.0.3sdkmanager “platforms;android-29sdkmanager emulator

Visual Studio Code Setup

Download Visual Studio Code from the following link: Install Vs Code then install Flutter extensions:

ext.JPG

Setting up your Android Device

Go to Settings > About Phones > Tap 7 Times on Build Number > Developer Option. Turn on USB Debugging and connect your phone to your system via USB cable and you are good to go.