blog-SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

The "SDK location not found" error occurs when Android Studio cannot find the Android SDK. Define the SDK location in the local.properties file or set the ANDROID_HOME environment variable.

Follow the below steps

•    Go to your react-native Project then go to the android directory Create a file with the following name:

local.properties

•    Open the file and paste your Android SDK path like below:

For windows users

sdk.dir = C:\\Users\\UserName\\AppData\\Local\\Android\\sdk

or (for newer versions of Android Studio / IntelliJ IDEA):

sdk.dir = C\:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk

Where USERNAME your PC user name. Also, make sure the folder is sdk or Sdk.

Example:

sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk

or:

sdk.dir = C\:\\Users\\USERNAME\\AppData\\Local\\Android\\Sdk

For Mac users

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

Where USERNAME is your OSX username.

For Linux (Ubuntu) users

sdk.dir = /home/USERNAME/Android/Sdk

Where USERNAME is your linux username (Linux paths are case-sensitive: make sure the case of S in Sdk matches)

In case this doesn't work, add ANDROID_HOME variable in "Environment Variables" as C:\Users\USER\AppData\Local\Android\Sdk

SDK_location_not_found_define_location_with_sdk_dir_in_the_local_properties_file_or_with_an_ANDROID_HOME_environment_variable.png