简体   繁体   English

如何在IntelliJ项目中添加新的Android API / SDK?

[英]How to add a new Android API/SDK to IntelliJ project?

How do I add a new Android API to my IntelliJ project? 如何在IntelliJ项目中添加新的Android API? I'm trying to add 20 and 21 to my Android project. 我正在尝试将20和21添加到我的Android项目中。 In the Project Structure view, when I select SDKs in the leftmost list view, I see API 7 - 19 along with the JDK. 在“项目结构”视图中,当我在最左侧的列表视图中选择SDK时,我会看到API 7-19和JDK。 When I use the plus (+) button, it allows me to scroll to the place where the SDK Manager apparently downloaded the latests SDKs, and I can browse and find (under the sources folder) android-20 and android-21 folders right along with all the others. 当我使用加号(+)按钮时,它可以滚动到SDK Manager显然下载了最新SDK的位置,并且我可以浏览并找到(在sources文件夹下)android-20和android-21文件夹与所有其他人。 But when I select one of them and then click the "Choose" button, nothing gets added. 但是,当我选择其中之一,然后单击“选择”按钮时,没有任何添加。 Inconceivable. 不可思议。 Here's what my Project Structure view looks like: 这是我的“项目结构”视图的样子:

在此处输入图片说明

And below is a pic of the contents of my Android SDK folder, although apparently the SDK Manager downloads specific API SDKs into the sources folder. 下面是我的Android SDK文件夹内容的图片,尽管显然SDK Manager将特定的API SDK下载到了source文件夹中。 In it I have SDKs 7 - 21 now. 我现在有7-21个SDK。

在此处输入图片说明

You should not select the subfolders, but rather the top-level SDK folder. 您不应选择子文件夹,而应选择顶层SDK文件夹。 Once you do this a dialog will be displayed showing all detected versions in that SDK structure, which you can then select to add. 完成此操作后,将显示一个对话框,显示该SDK结构中所有检测到的版本,然后可以选择添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM