Adding environmental variables to use android studio and emulator.

Before you start developing android apps or iOS apps with react native or with java/kotlin with android studio, you have to install a bunch of stuff and set environment variables to path variables correctly.

If you hesitate to do it, you will waste a lot of precious time as I did while scrolling through stack overflow and other forums for hours.

So lets learn how to setup your system for mobile app development.

Small bit of backstory [Feel free to skip]:

I bought a good laptop for college with education loan and I forgot to include all the environment variables and struggled a lot. Now finally, I have configured my machine to compile react native apps and even java/kotlin apps perfectly and run it on an emulator.

This tutorial will almost solve all your installation problems.

First steps:

Forget everything you did before and start fresh!

Install Java’s jre and jdk by downloading them from the given links below.

I made a big mistake of not downloading and installing jdk and started to get all sorts of errors.

The links to jre and jdk are below.

Carefully select the version and your OS specific ones and download and install them.

Now go to environment variables in your system and do as below.

chrome-capture (24)

Type the exact variable as I am typing here.

In Environment variables set JAVA_HOME to the location of your jdk and not jre.

JAVA_HOME --> C:\Program Files\Java\jdk-12.0.1

chrome-capture (29)

Now download android studio from the link below.

Android-Studio Link

After installing the android SDK along with the android studio, we have to set its path to environment variables.

Do the same as you did with Java jdk here as well.

chrome-capture (26)

ANDROID_HOME --> C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk

After doing that, you need to add three other SDK paths to the path variable like below.

You have to add,

  • The path to emulator,
  • The path to the bin,
  • The path to the platform tools,
chrome-capture (28)

After doing all the above steps carefully in the right place, you can now now build android apps without any issues.

Keep in mind to do all these steps again when you buy a new system, or you will really have a tough time figuring out what is the problem.

I wish people automated this stuff by setting all these environment variables at its appropriate place when installing the specific software.

Its too time confusing and frustrating to find out these were causing the problems and finding them in stack overflow and in forums.

As a beginner its a nightmare. But as I become more experienced it was not a big issue.

I have given you the list of all of them just use it whenever you need!

Thank you for reading!!

Check out my portfolio: Gautham’s portfolio

Check out my blog:

If you want to appreciate my or support me, you can buy me a coffee with the link below,

Buy Me a Coffee

My Other Articles:

Create your Web Presence with Namecheap

Leave a Comment

Your email address will not be published. Required fields are marked *