简体   繁体   中英

How do I install the standalone Android SDK and then add it to IntelliJ IDEA on Windows?

This is the webpage showing from where I downloaded the SDK:

这是下载的SDK的网页

On extracting the.zip folder, and opening the ' tools ' folder, all I can see in an emulator.exe, mksdcard.exe and a host of.bat files (as shown below).

这是文件夹的内容。

How do I proceed?

As Karan Sharma mentioned in this post.
To add an existing SDK, you should close your project if you have any open one. 关闭你的项目

Then from the Welcome page select Configure -> Project Defaults -> Project Structure 配置 - >项目默认值 - >项目结构

And then from the Default Project Structure window and from the left side, select SDKs and then the plus button from the toolbar, and from the menu select Android SDK 从菜单中选择Android SDK选项

And then give the address to the location where your Android SDK files are in, and hit OK. 最后结果

Thats it!
Now it should be working for you!

In IntelliJ IDEA 2017.1 and 2017.2 setting up Android SDK from scratch is complicated. I would recommended to install Android Studio and manage SDK platform there. This problem will be addressed in one of the nearest updates.

If you are brave enough, it's still possible to set it up without Android Studio using the tools\\bin\\sdkmanager.bat command line tool. GUI version of the SDK Manager is deprecated (no longer available in the SDK download). Standalone SDK can be downloaded here . Look below the Get just the command line tools section.

So, you will need to install at least one platform version.

First run the update to ensure you have the latest tools:

sdkmanager --update

Now you can list the packages available for installation:

sdkmanager --list

To install Android Platform:

sdkmanager platforms;android-26

To install the current build tools version (optional):

sdkmanager build-tools;26.0.0

At this point you should be able to add Android SDK configuration for the installed platform version in IntelliJ IDEA like this:

Android SDK

You will also have access to Android SDK configuration UI where you download additional components and perform updates (just like in Android Studio):

Android SDK UI

You can also install the SDK in the IDEA GUI. It says in the tutorial,

If you don't have the Android SDK configured, IntelliJ IDEA will detect this and prompt you to download it:

在此处输入图像描述

启动android可执行文件并安装平台和构建工具。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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