如何将 SDK 添加到 Android Studio? [英] How do you add an SDK to Android Studio?

查看:34
本文介绍了如何将 SDK 添加到 Android Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是基于 IntelliJ 的 Google 的 Android Studio 0.1,但我不知道如何向我的项目添加额外的 SDK.

I'm using Google's Android Studio 0.1 based on IntelliJ, and I cannot figure out how to add additional SDKs to my project.

我将现有项目从 Eclipse 导出到 Gradle 项目,然后将其导入 Android Studio,按照 Google 的推荐.

I exported my existing project from Eclipse to a Gradle project, which I imported into Android Studio, as recommended by Google.

我项目的 SDK 是 Google APIs 2.3.3.但是,我使用了一个名为 PullToRefresh 的库,它似乎需要 SDK 4.1,所以我正在尝试将 SDK 16 添加到我的项目中.

My project's SDK is Google APIs 2.3.3. However, I use a library called PullToRefresh which appears to need SDK 4.1, so I'm trying to add the SDK 16 to my project.

我已经确保使用 SDK 管理器下载 SDK.这些 SDK 会自动添加到 Android Studio.app 的 sdk 文件夹中.

I've already made sure to download the SDK using the SDK manager. These SDKs are added to the Android Studio.app's sdk folder automatically.

我打开了项目结构"窗口,单击平台设置"下的SDK",我目前看到的是 JDK 1.7 和 Google API 2.3.3.我单击该列表上方的 + 号以添加新的 SDK.然后我导航到具有 android-16 的 sdk 目录,如下面的屏幕截图所示.我不太确定这要我添加什么,但我已经突出显示了 android-16 文件夹(大约是我唯一可以选择的),当我单击选择"时,窗口消失了,但没有新的 SDK 出现在SDK 列表.

I opened the Project Structure window, clicked "SDKs" under Platform Settings, and I currently see JDK 1.7 and Google APIs 2.3.3 shown. I click the + sign above that list to add a new SDK. I then navigate to the sdk directory that has android-16, as shown in the screenshot below. I am not quite sure what this wants me to add, but I've highlighted the android-16 folder (about the only thing I can select), and when I click "Choose," the window disappears, but no new SDK appears in the SDK list.

这是我的 SDK Manager 视图的屏幕截图,显示了已安装的 SDK:

And here is a screenshot of my SDK Manager view, showing the installed SDKs:

推荐答案

我在 Google 的支持下也开了一张票,并收到了解决方案.如果您选择顶级sdk"文件夹,而不是选择 sdk/platform/android-16 文件夹,则会要求您选择要添加的 SDK.这奏效了!

I had opened a ticket also with Google's support, and received the solution. Instead of choosing the sdk/platform/android-16 folder, if you select the top-level "sdk" folder instead, you'll then be asked to choose which SDK you want to add. This worked!

这篇关于如何将 SDK 添加到 Android Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆