ERROR:SDK location is not found. Define location with
sdk.dir
In the Local.properties file or with an
ANDROID_HOME
environment variable. The problem is that Android studio does not find the local SDK, so there may be one of the following:
The Sdk.dir configuration of the 1.local.properties file is incorrect, resulting in Android studio not finding the SDK under the corresponding path
1. The corresponding solution is to re-check the environment variable path assignment to Sdk.dir
2. Locate the Local.properties file for other projects that can be run on this computer, and copy directly to the root directory of the folder that cannot run project
2. Environment variable android_home cannot be obtained and used correctly, then:
1?? : It is possible that the environment variable is misconfigured, causing problems, and of course this situation is often caused by a path error
2?? : The environment variable is configured successfully, but the above error occurs, which is the failure to get the environment variable.
Ps: So how to determine the problem caused by what kind of problem?
The simplest way to judge is to open the terminal input adb, if the ADB operation prompt command, then is the second case, if the command is not found so is the environment variable configuration when there is a problem, corresponding to the first case. (In the first case, please Baidu: "How to install Android SDK under Mac", recommend a blog http://www.cnblogs.com/yjmyzz/p/4219829.html)
This article focuses on the solution of the second case
The second scenario is rare, with most people experiencing problems with Local.properties or Android SDK installation failures and ANDROID_HOME environment variable configuration failures
So, what should we do when we encounter the second situation? (This seems to be the case IntelliJ the idea's IDE appears on the MAC)
First, the introduction of a Mac OSX environment variables and other operating systems under the difference between the command line under the MAC environment variables and the GUI environment variable reference is not the same, I believe you see this blog before also read a lot of corresponding articles, So the solution written in most articles is to create a. bash_profile file in the user's home directory, and then configure the appropriate environment variables on it, while the GUI on Mac uses a different set of environment variables, which are explained in detail as:
When it comes to this problem, we open the terminal and enter it in the terminal:
/usr/local/opt/android-sdk
, enter and restart your IDE, the sky will be a clear.
Mac Android Studio appears error:sdk location not found. Define location with Sdk.dir in the Local.properties file or with an android_home environment variable.