Android Studio - 如何更改Android SDK路径

穆嘉
2023-12-01

本文翻译自:Android Studio - How to Change Android SDK Path

When I open Android SDK Manager from Android Studio , the SDK Path displayed is: 当我从Android Studio打开Android SDK Manager时 ,显示的SDK Path是:

\android-studio\sdk

I want to change this path. 我想改变这条道路。 How do I do it? 我该怎么做?


#1楼

参考:https://stackoom.com/question/17Zfc/Android-Studio-如何更改Android-SDK路径


#2楼

From Android Studio 1.0.1 来自Android Studio 1.0.1

Go to

  1. File -> project Structure into Project Structure 文件 - >项目结构到项目结构
  2. Left -> SDK Location 左 - > SDK位置
  3. SDK location select Android SDK location (old version use Press +, add another sdk) SDK位置选择Android SDK位置(旧版本使用按+,添加另一个sdk)

#3楼

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. 然后在“平台设置”下的左侧选择SDK。 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. 然后在右侧选择当前的Android平台,我的是Android 4.2.2平台,并使用顶部的红色减号按钮删除它,然后使用顶部的绿色加号按钮添加一个新的Android平台并指向它你当前的SDK文件夹就是这样。


#4楼

您还可以创建环境变量(在Windows中)ANDROID_HOME到Android SDK的位置,Android Studio将使用它。


#5楼

Here's how you can change the android sdk path in Android studio: 以下是如何在Android studio中更改android sdk路径:

  1. Open your required android project in Android studio 在Android工作室中打开所需的Android项目
  2. Click on the main project folder and press F4 单击主项目文件夹,然后按F4
  3. Now click on "SDKs" under Platform Settings (Left hand side of the dialog box) 现在点击平台设置下的“SDK”(对话框的左侧)
  4. You should now see a plus sign on the top, click it and choose "Android SDK" 您现在应该在顶部看到加号,点击它然后选择“Android SDK”
  5. Now you would be asked to choose the required SDK folder 现在,系统会要求您选择所需的SDK文件夹
  6. Select the required build target(if necessary) and click "ok" 选择所需的构建目标(如有必要),然后单击“确定”
  7. Now you should see the new entry in the list of SDKs 现在,您应该在SDK列表中看到新条目
  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" 选择项目文件夹,在“模块SDK”的下拉列表中,选择新的SDK条目,然后单击“应用”
  10. Now click "OK" and your done. 现在点击“确定”完成。

Note: If changes do not take effect, restarting android studio should fix the problem. 注意:如果更改没有生效,重启android studio应该可以解决问题。


#6楼

EUREKA I found it! EUREKA我发现了它!

With the current Studio 1.3 each project has a local.properties file where you can edit the SDK! 使用当前的Studio 1.3,每个项目都有一个local.properties文件,您可以在其中编辑SDK!

 类似资料: