526

When I open Android SDK Manager from Android Studio, the SDK Path displayed is:

\android-studio\sdk

I want to change this path. How do I do it?

Zoe
  • 27,060
  • 21
  • 118
  • 148
dira
  • 30,304
  • 14
  • 54
  • 69
  • 7
    @GauravAgarwal, No, the accepted answer is also the correct answer as it leads to the same exact same place as Dheeraj Bhaskar's answer: "Android SDK location: This location will be used for new projects, and for existing projects that do not have a local.properties file with a sdk.dir property." In fact, the accepted answer is a little better than DheeB's answer because it automatically checks the current local.properties file for you for your current project (at the same time as it changes the default sdk location for all other Android projects that don't have one explicitly defined). – Stephan Branczyk Mar 02 '14 at 06:59
  • 3
    %AppData%\..\Local\Android\sdk is the location where ADT installed Android SDK on Windows 10 Technical Preview 64 bit – Tony Jan 10 '15 at 20:11
  • 4
    Make your life easy with shortcut keys `ctrl+shift+alt+S` – Abdul Manan Jul 28 '15 at 13:07

30 Answers30

641

From Android Studio 1.0.1

Go to

  1. File -> project Structure into Project Structure
  2. Left -> SDK Location
  3. SDK location select Android SDK location (old version use Press +, add another sdk)
Crossle Song
  • 10,104
  • 2
  • 29
  • 38
  • 7
    I don't want just change for the project, I want be able to select it before start the project, is it possible? Thanks in advance – Klaus Villaca May 23 '13 at 12:14
  • 2
    a note for mac users (at least for android studio 0.2.9): instead of F4, you can do command-; (i.e. File->project Structure). On the left you can change the project's sdk location. – qix Oct 16 '13 at 23:53
  • 3
    To KlausVillaca and @GauravAgarwal, You guys are mistaken. Android Studio isn't organized like ADT Eclipse at all. And this accepted answer leads to the exact same place as DheeB's answer (which brings you to a place that says: Android SDK location: This location will be used for new projects, and for existing projects that do not have a local.properties file with a sdk.dir property.") – Stephan Branczyk Mar 02 '14 at 06:48
  • 1
    Detailed answer with screenshot is here [http://stackoverflow.com/questions/30437653/unable-to-change-sdk-path-in-android-studio/30437913#30437913] – Takermania May 27 '15 at 06:48
  • A small mistake I made was that I didn't first copy my oldpath/sdk folder in my desiredpath/sdk folder, so changing paths wasn't working because there was no SDK found there. – Răzvan Barbu Jul 16 '15 at 08:12
621

For projects default:

  1. Close current Project (File->Close project)

You'll get a Welcome to Android Studio Dialog. In that:

  1. Click on Configure -> Project Defaults -> Project Structure

  2. Click on SDK Location in the left column

  3. Put the path to the Android SDK in "Android SDK location" field.

(Example SDK location: C:\android-sdk; I have sub-folders like add-ons, platforms etc under C:\android-sdk)

  1. Click OK to save changes

  2. Have fun!

Following steps were for older versions(<1.0) of Android Studio

  1. In the middle column Click on Android SDK (with Android icon) OR click + on the top if you don't see an entry with Android icon.

  2. Change SDK Home Path and select valid Target.

Arun J
  • 687
  • 4
  • 14
  • 27
Dheeraj Bhaskar
  • 18,633
  • 9
  • 63
  • 66
  • I did this, but when I try to create a new project, it still references the old directory. – gian1200 Nov 01 '13 at 23:46
  • Please tell us what you did exactly. We can't even help too with such a vague comment. – Dheeraj Bhaskar Nov 02 '13 at 04:39
  • 2
    Open Android Studio. On Welcome to Android Studio Window click configure-> Project Defaults ->Project Structure. (From this step it changes a little bit. I'm using version 0.3.2). In the left column under Platform Settings click Android SDK. Select the and put the new path under "Android SDK Location" using the dialog --> "C:/Users//android-sdks" (Instead of says the real one). Apply (and reset Andr Studio, just in case). The path was saved successfully. Again under Platform Settings, click on SDKs. Now in the middle column I can see all the sdks installed on the new path – gian1200 Nov 02 '13 at 18:23
  • 2
    However, when I try to create a new project (Welcome to Android Studio --> New Project), the options available for "compile with" are the sdks available on the "old path" instead of the new/updated one. – gian1200 Nov 02 '13 at 18:26
  • 3
    "I fix it", but I think it is a bug. The explanation: on default sdk path there is API 17, on the new one I have APIs 15, 18 and 19. Inside SDKs under Platform Settings, I had listed APIs 15, 17, 18, 19. After erasing the API 17 (using the red minus), the "New Project Dialog" now shows the correct list for the "compile with" option. – gian1200 Nov 02 '13 at 21:15
  • @gian1200 glad you could fix it. I'm still on 0.2.9 milestone release. Please suggest an update to the answer if you want me to add your workaround. – Dheeraj Bhaskar Nov 03 '13 at 08:52
  • 2
    @Lukasz'Severiaan'Grela, No, this answer leads you to the exact same screen as the instructions in the accepted answer, which modifies the settings for almost all projects, not just the existing one. See "Android SDK location: This location will be used for new projects, and for existing projects that do not have a local.properties file with a sdk.dir property." – Stephan Branczyk Mar 02 '14 at 06:52
  • 1
    I performed the steps in both: the marked-as-best and this most-upvoted answer, but it didn't fix the SDK dependency. So, I shut down Studio, deleted android-studio/sdk folder and started Studio again. Then it said that it couldn't find the android-studio/sdk and, therefore, it would use the default sdk (which was selected according to the aforementioned steps). Only after this everything worked fine. So, it looks like Studio might still prefer its 'native' sdk to the default one, set in settings. – Coryffaeus May 07 '14 at 16:25
  • @Coryffaeus That's strange. I don't think it's a preference, it must have been they picked up recently. But it must've been something else, 'cause it's very strange that neither this nor the accepted answer worked. – Dheeraj Bhaskar May 07 '14 at 20:47
  • is it possible to delete the Android SDK shipped with Android Studio? I'm not gonna use it as far as i have my own installation of Android SDK, shared beetween eclipse and Android Studio. – voghDev May 22 '14 at 17:28
  • yes, and I have. Change SDK and shutdown Android Studio first. – Dheeraj Bhaskar May 22 '14 at 20:59
  • 4th and 5th step may not available in Android Studio 1.0.2 – Pratik Butani Jan 08 '15 at 07:02
  • @ツFellinLovewithAndroidツ could you edit the answer to reflect your experience? – Dheeraj Bhaskar Jan 08 '15 at 08:32
  • 1
    Please, have all of my +1's. – DDPWNAGE Sep 29 '15 at 15:06
  • Please add ,SDK path should not contain white spaces. – URAndroid Nov 24 '15 at 10:24
36

From the quick start window, choose Configure, then choose Project Defaults, and then choose Project Structure. Then on the left under Platform Settings choose SDKs. Then to the right of that choose the current android platform, mine was Android 4.2.2 Platform, and delete it using the red minus button at the top, then add a new android platform using the green plus button at the top and point it to your current SDK folder and that is it.

JosephN
  • 404
  • 3
  • 7
  • This worked for me - though I did first try to do this to a project I had open. Changing the Default settings and re-importing the project allowed it to work. – stackdump Jun 05 '13 at 18:06
  • what do you mean with "quick start window"? – raudi Jun 17 '13 at 11:22
  • Quick start window is the window that is showed automatically when no project are open in android studio. – lukasz Jun 23 '13 at 14:11
  • Excellent, this answer is the unique of all that works when not project created yet, that is my case – Aracem Jul 25 '13 at 10:06
  • Doesn't work for me, not really sure what to do now. Anyone got any ideas? Why is nothing ever easy when developing for Android. – Rob Aug 15 '13 at 20:21
32

I Configured in this way

on

Welcome to Android Studio Screen

Click Configure Then

Project Defaults and then Project Structure

Then Android SDK and Selected the path to my current location of Android SDK enter image description here

enter image description here

For Guru
  • 1,197
  • 13
  • 23
25

Changing the sdk location in Project Settings will solve the problem partially. When Android Studio is used to download a new SDK, it will place the new SDK in the internal SDK folder (inside Android Studio).

Existing android developers will already have a large sdks folder (hereinafter referred to as external SDK folder) containing all the SDKs downloaded before Android Studio came around.

For Mac/Linux users though there is a good way out. Soft links!

Exit Android Studio and perform the following steps:

cp -r <Android Studio>/sdk/ <external SDK folder>/
cd <Android Studio>/
mv <Android Studio>/sdk/ mv <Android Studio>/sdk.orig
ln -s <external SDK folder>/ sdk

And we're good to go. Launch SDK Manager after starting Android Studio, watch as it discovers all your existing SDKs like a charm :).

mayank_io
  • 440
  • 5
  • 8
  • 3
    For Windows rename /sdk to sdk.orig & create a soft symbolic link by running cmd: mklink /d ./sdk C:\ from inside – dwp4ge Dec 12 '13 at 02:48
14

EUREKA I found it!

With the current Studio 1.3 each project has a local.properties file where you can edit the SDK!

Luís Cruz
  • 14,780
  • 16
  • 68
  • 100
raudi
  • 1,701
  • 1
  • 16
  • 16
  • my `local.properties` file has the following comment at the top" `## This file is automatically generated by Android Studio. # Do not modify this file -- YOUR CHANGES WILL BE ERASED!` – jacoballenwood Mar 03 '18 at 00:49
13

Here's how you can change the android sdk path in Android studio:

  1. Open your required android project in Android studio
  2. Click on the main project folder and press F4
  3. Now click on "SDKs" under Platform Settings (Left hand side of the dialog box)
  4. You should now see a plus sign on the top, click it and choose "Android SDK"
  5. Now you would be asked to choose the required SDK folder
  6. Select the required build target(if necessary) and click "ok"
  7. Now you should see the new entry in the list of SDKs
  8. Click "Modules" under Project Settings
  9. Select your project folder and in the Dropdown for "Module SDK", select the new SDK entry and click "apply"
  10. Now click "OK" and your done.

Note: If changes do not take effect, restarting android studio should fix the problem.

Aditya Gaykar
  • 470
  • 1
  • 5
  • 10
9

Make your life easy with shortcut keys
ctrl+shift+alt+S
or

by going to file->project structure:
enter image description here

it will open this window, where you can select your SDK
enter image description here

Abdul Manan
  • 2,255
  • 3
  • 27
  • 51
7

Try this way i try in Android Studio 2.0
Step 1: File->Settings
Step 2: Settings->SDK options
Step 3: Click Edit option in Sdk Location
Step 4: Show "SDK Components Setup"
Step 5: Click on Three "..." in "SDK Components Wizad"
Step 6: Select your new SDK Path
enter image description here

Liam
  • 6,009
  • 4
  • 39
  • 53
Bipin Bharti
  • 1,034
  • 2
  • 14
  • 27
6

I noticed that the latest version of Android Studio doesn't seem to have the option "SDKs" path that's mentioned in many of the answers. I'm guessing that disappeared in one of the updates, somewhere down the line?

The way i solved this issue (osx) was:

  1. Go to Project Settings (Cmd + ;)
  2. In SDK Location make sure you're pointing to the correct SDK location (typically /Applications/Android Studio.app/sdk) then hit Apply
  3. Most important step - hit "Sync Project with Gradle files"

I wasn't doing Step 3 and that was throwing me off. After a sync all your source r belong to us....

KG -
  • 7,130
  • 12
  • 56
  • 72
6

goto menu File->Project Strucurt or key Ctrl + Alt + Shift + S

enter image description here

and example http://how-to-android-studio.blogspot.com/2014/11/set-sdk-location.html

5

You can also create the environment variable (in Windows) ANDROID_HOME to the location of the Android SDK and Android Studio will use that.

oceanfeeling
  • 263
  • 2
  • 11
  • 2
    This doesn't work for me. at least not if i set it to the root of the sdk (win7/studio1.3) – raudi Jun 17 '13 at 11:19
4

Above answers are pretty correct, but some times Android Studio, does not like to refresh after SDK path change, a quick solution is to make some change in you Build file, and click on Sync. It will refresh you project.

Happy coding... :)

Sanchit
  • 460
  • 3
  • 14
4

While first installation There are two situations either you have pre-installed Android SDK if you had used it in past or you have nothing at all, At a time of installation Installer always ask user how you want to configure SDK with your studio.

You can simply give a path here or browse folder where sdk is available in local system. If you already have SDK, Another option as shown in below picture at Left down corner there is a nice option for download SDK, by clicking it you can download SDK with latest release right from there,You can also use third option see in right down corner setup Android SDK for me by clicking it you can step by step set your sdk.

enter image description here

Although you can also set it up when Android shows you list of available projects, a starting prompt window shown below

enter image description here

That's pretty easy, and also sometime if you want to change your SDK you can always change it right in your Android Studio from

On windows system File --> Project Structure and then you will see SDK Location Option and from there you can set it up by providing a path or by browse it.

enter image description here

Or if you are on MAC system then from Platform settings.

enter image description here

TapanHP
  • 5,969
  • 6
  • 37
  • 66
4

In Android Studio 2.2.3 I think you can change default SDK location for all projects from the top menu:

File -> Project Structure...

A window like below shows up:

enter image description here

Bianca Daniciuc
  • 920
  • 1
  • 13
  • 22
3

in windows press ctrl+shift+alt+s which will open project properties where you can find first option named SDK Location click on it and there you can change SDK path, JDK path and NDK path also

2

This may not be what you want, but being an eclipse user I had the same problem having duplicate sdk folders which were eating all my ssd space. Currently you can only change sdk path inside android studio project wide which is annoying. What I did instead was I copied all the previous android sdk files that I was using with eclipse to /Android Studio/sdk/ and then just changed the sdk path inside eclipse.

Now both android studio and eclipse are happy.

Nima
  • 6,383
  • 7
  • 46
  • 68
2
  1. Tap --> file --> close current project.

You'll Android Studio home page

  1. Click on Configure -> Project Defaults -> Project Structure

  2. Click on SDK Location in the left column and copy the path.

  3. Paste the path in My computer --> Right Click -> Properties -> click on Advanced system settings -> Environment variables and change the android home path.

  4. click on 'OK' to save the session.

  5. Add tools and platforms tools in path and save the changes.

  6. Open command prompt[window+R] and type adb + enter.

Vishnu
  • 21
  • 1
2

Here is some ways, as far as I know now.

  • Android Studio 3.3.2 (testing is OK)

method: 1

just following steps of the official docs, as bellow link shows

https://developer.android.com/studio/intro/studio-config#jdk

method: 2

following steps of the screen shortcuts, as bellow shows

enter image description here

enter image description here

method: 3

following steps of the screen shortcut, as bellow shows

enter image description here

xgqfrms
  • 10,077
  • 1
  • 69
  • 68
1

In Android Studio you can set the general Android SDK path in the file: %Home%.AndroidStudio2.1\config\options\jdk.table.xml

Ujjwal Singh
  • 4,908
  • 4
  • 37
  • 54
  • 1
    My android studio won't run on Windows because I imported a config setting from my Linux, delete the jdk.table.xml make it solve for me. Thanks – Zainal Fahrudin Oct 25 '22 at 07:21
1
  1. Click on File menu.
  2. Select Project Structure.
  3. Edit the path in SDK Location text box. From the next time Android Studio will use this location for all your projects.

N.B.: Avoid having spaces in the path as it may sometimes lead to issues.

Sanket B
  • 1,070
  • 1
  • 9
  • 23
  • No. You can either remove the space from the path or move the folder to a complete new location which doesn't contain spaces. – Sanket B Apr 17 '17 at 17:53
1

This is how its done,in Android Studio for windows First got to Project Structure

Then to sdk location tab

From there select android sdk location and select your sdk path and then click on OK button

Done

Abhijeet
  • 36
  • 10
1

For Android Studio 3.1.2:

Tools>> SDK Manager>> Edit "Android SDK Location" to new location

After that, Set environment variable $ANDROID_HOME to your new SDK location

clrajapaksha
  • 59
  • 1
  • 7
0

I had the same problem, but with the sdk path pointing to a mounted drive. I found, that simply quit Android Studio, unmount the device and restart Android Studio made it ask for the sdk location, because it had none (Android Studio Beta 0.8.7).

Therefore I guess if you just quit Android Studio, delete \android-studio\sdk or move it somewhere else and start Android Studio again, it should ask for the sdk location aswell.

0

Though many of the above answers serve the purpose, there is one straight forward thing we can do in project itself.

In Eclipse, go to Window->Preferences, select "Android" from left side menu. On the right panel you will see "SDK Location". Provide the path here.

Good luck.

Durga Mohan
  • 1,110
  • 9
  • 11
0

In Android studio 1.2.2 you can simply changes project based SDK, Steps:

  1. Right click on Module and select Open module setting or press F12
  2. Select SDK location from left hand side
  3. Now you can change SDK location as well as JDK location from this page
Pankaj kumar
  • 1,357
  • 14
  • 13
0

When I ran into trouble with this on Android Studio 3.1.4 the solution was to go into the app dropdown on my project, then Edit Configurations > Defaults > JAR Application where there is a JRE box on the initial Configuration tab. Setting that to my JRE path solved the problem for me.

glenatron
  • 11,018
  • 13
  • 64
  • 112
0

Simple Answer Work For Sure...

Step 1: Right Click On The Project>> Select Open Module Setting --> Step 2: Select SDK Location From the Right Side below image

enter image description here

Step 3: Now browse the SDK location from your computer as show below... enter image description here

Step 4: Click on OK.

0

I'm guessing from the responses that people aren't understanding your question... If I'm right in that you want to have ~\Desktop\github\ then changing the SDK location isn't what you're after.

From Android Studio 3.2.1: From the new project dialog, choose Configure -> Preferences -> Tools -> Terminal -> Start Directory

Put the folder you want as your project default in the field.

e.g. Mine is set to ~/Desktop/github/ since all my work is in ~/Desktop/github/

Leo G.
  • 28
  • 5
0

Just go to (Main Menu) File > "Sync Project With Gradle Files" click ok on the popup, it will change your sdk directory.