Android Studio - How to Change Android SDK Path

2018-12-31 05:33发布

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?

30条回答
不流泪的眼
2楼-- · 2018-12-31 06:24

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

查看更多
妖精总统
3楼-- · 2018-12-31 06:24

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

查看更多
人气声优
4楼-- · 2018-12-31 06:25

for projects default:

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

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

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

3. Click on SDK Location in the left column

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

5. Click OK to save changes


6. Have fun!


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

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

5. Change SDK Home Path and select valid Target

查看更多
一个人的天荒地老
5楼-- · 2018-12-31 06:25

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

查看更多
呛了眼睛熬了心
6楼-- · 2018-12-31 06:26

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

查看更多
宁负流年不负卿
7楼-- · 2018-12-31 06:26

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.

查看更多
登录 后发表回答