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.

Source: Internet
Author: User

ERROR:SDK location is not found. Define location with sdk.dirIn the Local.properties file or with an ANDROID_HOMEenvironment 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.