Setting up Flutter without Android Studio

So most of us have this difficulty who want to work on Android App Development but do not have a machine powerful enough to run Android Studio. Well, the good news is, we’ll be setting up an environment where we will be able to work with flutter without Android Studio.

Kyaa baat kar raha hai? ( English Translation — Wait,seriously? )

So, without further ado, let’s get started.

Setting up Java

We’ll be working with Java 8. Download Java 8 from here. You’ll have to create an account on Oracle. Complete the installation process of Java 8. Once done, open your Command Prompt (Windows) / Terminal (MacOS / Linux), and run java -version. You should see a screen similar to the one shown below.

A screen which shows Java version “1.8.0_221” and Java SE Runtime versions
java -version output

Flutter Installation

Download flutter from the official website (here). Create a folder in the Downloads folder called flutterSDK. Copy the flutter zip folder there and extract the folder there. In the extracted folder, there would be a bin folder. Copy the path of the bin folder. We’ll be using the copied path in the future.

Press the windows key. Type ‘env’ and a search result stating Edit Environment Variables will popup. Open that screen and click on the Environment Variables button. In the PATH variable, click new to add the path copied in the previous step. Save all changes and reopen your Command Prompt. Run flutter to verify your changes. Be sure to add the Flutter path to the correct PATH variable.

Open terminal. Run nano .bash_profile. A window would open, write

export PATH=path/to/bin/folder/copied/in/the/above/step/

Press ctrl+x to close the file.Press Y to save the file and then press enter. Run

source .bash_profile

Exit the terminal session. Open a new session, and run flutter doctor to confirm the installation.

Great :D

Setting up Android Studio command line components

Download the Command Line Tools Only from here. Make a folder called tools, and extract them there. Open the extracted folder and copy it’s path. We’ll be using that in the next step.

Press the windows key. Type ‘env’ and a search result stating Edit Environment Variables will popup. Open that screen and click on the Environment Variables button. Create a new environment variable called ANDROID_HOME and set the path to the path that was copied in the last step. Save the variable. Edit the PATH variable. Add the same path copied in the previous step, but add a bin/ path to it. Open Command Prompt and run sdkmanager to see if it’s working

Open terminal. Run nano .bash_profile. A window would open, write

export PATH=path/to/folder/copied/in/the/above/step/bin/

export ANDROID_HOME=path/to/bin/folder/copied/in/the/above/step/

export ANDROID_SDK_ROOT=path/to/location/of/folder/downloaded/

Press ctrl+x to close the file.Press Y to save the file and then press enter. Run

source .bash_profile

Exit the terminal session. Open a new session, and run sdkmanager to confirm the installation.

Remember, Java 8 is a must for the sdkmanager to run

Done :D

Setting up sdkmanager

Run sdkmanager --list to see a list of all sdkmanagers available. Run sdkmanager “platform-tools” “platforms;android-28”. Also, run sdkmanager “build-tools;28.0.3”. This would download specific tools used for development while working with Android App Development. You might be asked to accept a few licenses. Press y and enter to accept the licenses. After the downloads have completed,

Press the windows key. Type ‘env’ and a search result stating Edit Environment Variables will popup. Open that screen and click on the Environment Variables button. Edit the PATH variable and add $ANDROID_HOME\tools, $ANDROID_HOME\platforms and $ANDROID_HOME\platform-tools to PATH. Accept all changes.

Open terminal. Run nano .bash_profile. A window would open, write

export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools

export PATH=$PATH:$ANDROID_SDK_ROOT/platforms

Press ctrl+x to close the file.Press Y to save the file and then press enter. Run

source .bash_profile

Exit the terminal session and open a new session.

A few final steps

Congratulations, you’re almost there. Just bear with me for a few steps more. Run flutter doctor. It might say something like “you-have-not-accepted-the-license-agreements”. Just run flutter doctor --android-licenses and accept all licenses by pressing y and enter.

flutter doctor -v

We’re live :D

Congratulations! You have successfully setup Flutter with using Android Studio Command Line Tools. Just start hacking now and have fun.

My articles are free, but you know you can press the clap👏 button like about a 100 times? The higher you go, the more it motivates me to write more stuff for you! Feeling super generous? Buy me a pizza 😋.

I am Dewansh Rawat. Designer. Developer. Hustler. Wanna Stalk? Here. Wanna connect? Just drop me an email at dewanshrawat15@gmail.com. Nice meeting you 😄

Designer | Developer | Hustler