Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AndroidStudio SDK directory does not exists

I am using Android Studio for a project on SVN (usually on Windows PCs).

Lately I want to run this on a Mac, it keep giving the below error:

Error:The SDK directory '/Users/AhmadMusa/Desktop/[PROJECT PATH]/D:\Android\sdk' does not exist.
Please fix the 'sdk.dir' property in the local.properties file.

I already put the SDK on local.properties file as:

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

I don't know why it keep adding the (D:\Android\sdk) automatically, this is my Windows PC SDK directory, but why it is here now! nothing on code mention any D:\Android\sdk.

like image 306
Ahmad Musa Avatar asked Aug 21 '15 21:08

Ahmad Musa


People also ask

Can not find Android SDK folder?

If you have downloaded the AS + SDK bundle: Note #2: you will never find the SDK in the Android Studio directory unless you have explicitly put it in there. The reason is that those directories might be deleted after installing a newer version of Android Studio and you would have to re-install the SDK as well.

How do I fix Android SDK not found?

Quick fix: Uninstall Android SDK (default location C:\Users\.. \AppData\Local\Android\Sdk ) and install it again. This time affirms the minimum required storage space at your place of download. After execution check, if tools folder is now added in SDK directory.

Where is the Android Studio SDK folder?

by default, the "Android Studio IDE" will be installed in " C:\Program Files\Android\Android Studio ", and the "Android SDK" in " c:\Users\username\AppData\Local\Android\Sdk ".

How fix SDK location?

Close the current project and you'll see a pop-up with a dialog which will then proceed to Configure option. Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local. properties and select Valid Target.


2 Answers

Right click your project and select 'Open Module Settings' under SDK Location put your location for your SDK.

paste in /Users/AhmadMusa/Library/Android/sdk

Clean and rebuild your project

Update

Try to delete your local.properties file and create a new one, but do not check it into version control.

Right click top level of project and Create new file 'local.properties' then add: sdk.dir=/Users/AhmadMusa/Library/Android/sdk

Clean and build

like image 145
kandroidj Avatar answered Sep 29 '22 18:09

kandroidj


I finally find this file on the disk.The 'local.properties' file in The Android studio is not which you modify.see the picture,so you can modify this line 'sdk.dir' to your dir of sdk.Remember not in the android studio. enter image description here

like image 36
nihaoqiulinhe Avatar answered Sep 29 '22 19:09

nihaoqiulinhe