How to fix the SDK location not found error in Android Studio

Oscar de la Hera Gomez
A flower that represents Android Studio. Beneath it sits the text "SDK Location not Found."

A solution for fixing the error "SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at."

This article aims to solve the issue that arises when your Android Studio cannot find the Android SDK location, producing an error similar to that shown below.

A screenshot of Android Studio, showing the error that begins with "SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at " and ends with the location of the local properties file.

Step One: Make sure that the file exists

A screenshot of Android Studio showing the location of the local.properties file. It is found at the root of the project.

Make sure that the local.properties file exists.

If it does not, create it.

Step Two: Add the SDK path

A screenshot of Android Studio showing the local.properties file with the sdk.dir added.

In the local.properties file, add the line below.

sdk.dir=/Users/YOUR_USERNAME/Library/Android/sdk

Make sure to replace YOUR_USERNAME with the username that appears on terminal.

A screenshot of Terminal showing a red box over the area that shows the name of your username and your machine.

If you open your terminal, you should see YOUR_USERNAME@YOURMACHINE in the area where the red box is above.

Copy YOUR_USERNAME from your terminal to make sure that you give the SDK the right location.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details