• Register
0 votes
797 views

Problem :

I recently tried to import the sample Android games which I downloaded from Google's developer website. After importing them into my Android Studio, I am getting the below error:

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

What is this error means? I want to run my sample programs from a Android Studio.

7 5 2
3,870 points

1 Answer

0 votes

Solution :

You need to just follow below steps it worked for me:

· Go to the react-native Project then go to the android directory Create the file with below name

local.properties

· Open a file and paste the Android SDK path as shown below :

For the windows users:

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

Replace the UserName with your pc user name . Also make sure that the folder is sdk or Sdk. In my case my computer user name is AbhijitJ so my path look like :

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

For the Mac users:

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

Where the USERNAME is your OSX username

For the Linux (Ubuntu) users:

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

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

In case if this doesn't work for you then add ANDROID_HOME variable in the "Environment Variables" as follows C:\Users\USER\AppData\Local\Android\Sdk

9 7 4
38,600 points

Related questions

0 votes
1 answer 5 views
5 views
When i am applying Google OBB downloader this problems happens. I am browsing serveral forums however didn’t get the desired result. Anyone here give me the specific solution.
asked Sep 14 Daniel Anderson 4k points
0 votes
1 answer 18 views
18 views
Problem: I am at the moment facing below error in my android studio after importing my Project: Error:(16, 0) Gradle DSL method not found: 'android()' Possible causes: The project 'LoginActivity' may be using a version of Gradle that does not contain the method. ... fuctionality (eg: editing, debugging) will not work properly. Please guide me to get rid of the above problem as soon as possible.
asked Sep 1 Raphael Pacheco 4.9k points
0 votes
2 answers 4.4K views
4.4K views
Problem : While running the app on a virtual device (AVD) created on Android studio (in a Windows 10), I am getting below error and panic. Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT Emulator: Process finished with exit code 1 I have already defined the ANDROID_SDK_ROOT in my environment variables. Can anyone please explain me how to resolve above problem?
asked Jan 23 jwilliam 3.9k points