Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - How to Change Android SDK Path

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?

like image 249
dira Avatar asked May 16 '13 07:05

dira


People also ask

Where is sdk path in Android Studio?

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 ".

Can I move Android SDK folder?

Is it possible to move these folders to an external hard drive? If it is possible what changes should I make in the android studio? Yep - Go into settings in android studio and you can select where you want the sdk to reside.

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.


22 Answers

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)
like image 88
Crossle Song Avatar answered Oct 05 '22 04:10

Crossle Song


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.

like image 20
Dheeraj Bhaskar Avatar answered Oct 05 '22 04:10

Dheeraj Bhaskar


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.

like image 25
JosephN Avatar answered Oct 05 '22 05:10

JosephN


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

like image 44
For Guru Avatar answered Oct 05 '22 05:10

For Guru


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 :).

like image 36
mayank_io Avatar answered Oct 05 '22 04:10

mayank_io


EUREKA I found it!

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

like image 43
raudi Avatar answered Oct 05 '22 05:10

raudi


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.

like image 37
Aditya Gaykar Avatar answered Oct 05 '22 06:10

Aditya Gaykar


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

like image 42
Abdul Manan Avatar answered Oct 05 '22 06:10

Abdul Manan


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

like image 23
Bipin Bharti Avatar answered Oct 05 '22 06:10

Bipin Bharti


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....

like image 31
Kaushik Gopal Avatar answered Oct 05 '22 06:10

Kaushik Gopal


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

like image 40
Sumeta Pongpanna Avatar answered Oct 05 '22 06:10

Sumeta Pongpanna


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

like image 32
oceanfeeling Avatar answered Oct 05 '22 04:10

oceanfeeling


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... :)

like image 22
Sanchit Avatar answered Oct 05 '22 05:10

Sanchit


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

like image 30
TapanHP Avatar answered Oct 05 '22 06:10

TapanHP


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

like image 20
Bianca Daniciuc Avatar answered Oct 05 '22 05:10

Bianca Daniciuc


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

like image 43
Kalpit Champanery Avatar answered Oct 05 '22 05:10

Kalpit Champanery


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.

like image 40
Nima G Avatar answered Oct 05 '22 06:10

Nima G


  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.

like image 40
Vishnu Avatar answered Oct 05 '22 04:10

Vishnu


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

like image 34
xgqfrms Avatar answered Oct 05 '22 05:10

xgqfrms


  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.

like image 39
Sanket B Avatar answered Oct 05 '22 06:10

Sanket B


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

like image 40
Abhijeet Avatar answered Oct 05 '22 04:10

Abhijeet


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

like image 27
clrajapaksha Avatar answered Oct 05 '22 05:10

clrajapaksha