简体   繁体   English

IntelliJ缺少Android SDK

[英]IntelliJ missing Android SDK

在此处输入图片说明

在此处输入图片说明

Please see the pictures above 请看上面的图片

When I click on Android in IntelliJ, this message appears: 当我在IntelliJ中单击Android时,将显示以下消息:

Your Android SDK is missing. 您的Android SDK丢失。 out of date, or is missing templates. 过期或缺少模板。 Please ensure you are using SDK version 24.0.2 or later. 请确保您使用的是SDK版本24.0.2或更高版本。 You can configure your SDK via Configure | 您可以通过配置|配置您的SDK。 Project Defaults | 项目默认值| Project Structure | 项目结构 SDKs 软件开发工具包

So I click Java at the top and then click to specify the path to java 9.0. 因此,我单击顶部的Java,然后单击以指定Java 9.0的路径。 But I still have problems, so I went into the Android studio and selected Android SDK to install several SDKs including 8.0. 但是我仍然遇到问题,因此我进入了Android Studio,并选择了Android SDK来安装包括8.0在内的多个SDK。 But still Android SDK is missing. 但是仍然缺少Android SDK。 Why is IntelliJ not finding the Android SDK? 为什么IntelliJ找不到Android SDK? Do I need to set environment variables? 我需要设置环境变量吗?

Why is IntelliJ not finding the Android SDK? 为什么IntelliJ找不到Android SDK?

You need to add it. 您需要添加它。 In Android studio, it gets automatically added when you install it. 在Android Studio中,安装时会自动添加它。 But IntelliJ IDEA will not know where it is. 但是IntelliJ IDEA将不知道它在哪里。 Go to File > Project Structure > "SDKs" under "Platform Settings" . 转到“平台设置”下的文件>项目结构>“ SDK” Click the plus sign at the top and select "Android SDK". 点击顶部的加号,然后选择“ Android SDK”。 You'll need to select the SDK from its installation location (you want to navigate to the Android/sdk directory). 您需要从安装位置中选择SDK(要导航到Android/sdk目录)。

在此处输入图片说明

That said... you're probably better off using Android Studio to do your Android development until you become a bit more experienced with the IDE unless there is a compelling reason you need to use IntelliJ IDEA (such as support for an additional language). 就是说...除非您有令人信服的理由需要使用IntelliJ IDEA(例如,对其他语言的支持),否则您最好还是使用Android Studio进行Android开发,直到您对IDE有所了解为止。 。

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

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