当我从Android Studio打开Android SDK管理器时,SDK路径显示为:

\android-studio\sdk

我想改变这条路径。我该怎么做?


当前回答

下面是如何在android studio中更改android sdk路径:

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

注意:如果更改没有生效,重新启动android studio应该可以解决这个问题。

其他回答

在项目设置中改变sdk位置将部分解决这个问题。当Android Studio用来下载一个新的SDK时,它会将新的SDK放在内部SDK文件夹中(在Android Studio内部)。

现有的android开发者已经有了一个很大的SDK文件夹(以下简称外部SDK文件夹),其中包含了在android Studio出现之前下载的所有SDK。

对于Mac/Linux用户来说,这是一个很好的解决方法。软链接!

退出Android Studio,执行以下步骤:

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

我们可以开始了。启动Android Studio后启动SDK管理器,观看它发现所有现有的SDK就像一个魅力:)。

使用快捷键ctrl+shift+alt+S使您的生活更轻松 或 通过去>文件项目结构:

它会打开这个窗口,在这里你可以选择你的SDK

这里有一些方法,据我所知。

Android Studio 3.3.2(测试正常)

方法:1

只是按照官方文档的步骤,如下面的链接所示

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

方法:2

以下步骤的屏幕快捷方式,如下所示

方法:3

以下步骤的屏幕快捷方式,如下所示

点击文件菜单。 选择项目结构。 在“SDK Location”文本框中编辑路径。 从下次Android Studio将使用此位置为您的所有项目。

注意:避免在路径中有空格,因为它有时可能会导致问题。

下面是如何在android studio中更改android sdk路径:

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

注意:如果更改没有生效,重新启动android studio应该可以解决这个问题。