简体   繁体   English

适用于Intellij IDEA的Android sdk

[英]Android sdk for Intellij IDEA

I'm trying to setup IntelliJ IDEA to develop android applications and I faced an issue with android sdk. 我正在尝试设置IntelliJ IDEA来开发Android应用程序,我遇到了android sdk的问题。 As far as I know, I need to download the sdk separately. 据我所知,我需要单独下载sdk。 But I all I managed to find was Android command line tools which is obviously not something I need. 但我设法找到的是Android命令行工具,这显然不是我需要的东西。 So my question how can I get android sdk for IntelliJ IDEA? 所以我的问题是如何获得IntelliJ IDEA的android sdk?

Same problem I have with IDEA 2017.1.1. 与IDEA 2017.1.1相同的问题。 I installed tools_r25.2.3-windows.zip and managed to install them . 我安装了tools_r25.2.3-windows.zip并设法安装它们 I've done: 我弄完了:

  1. unzipped it to C:\\Android\\android_sdk\\ 将其解压缩到C:\\ Android \\ android_sdk \\
  2. renamed "tools" folder to "tools-sdk" 将“tools”文件夹重命名为“tools-sdk”
  3. executed C:\\Android\\android_sdk\\tools_inst\\bin>sdkmanager --update 执行C:\\ Android \\ android_sdk \\ tools_inst \\ bin> sdkmanager --update
  4. prepared file my_file with lines: 用行准备文件my_file:

    build-tools;24.0.0 构建工具; 24.0.0

    platforms;android-24 平台; Android的24

    tools 工具

    emulator 模拟器

  5. Executed: C:\\Android\\android_sdk\\tools_inst\\bin>sdkmanager --package_file=my_file 执行:C:\\ Android \\ android_sdk \\ tools_inst \\ bin> sdkmanager --package_file = my_file

Then gave IntelliJ IDEA folder C:\\Android\\android_sdk as Android SDK Home Folder. 然后将IntelliJ IDEA文件夹C:\\ Android \\ android_sdk作为Android SDK主文件夹。

Then IDEA asks to install something additional. 然后IDEA要求安装额外的东西。 The test android project compiles and runs on emulation (AVD Manager works). 测试android项目编译并在仿真上运行(AVD Manager工作)。 I had to install 22 Platform and Build Tools though because android-24 virtual device asked for a password. 我不得不安装22平台和构建工具,因为android-24虚拟设备要求输入密码。

The only problem is I still have no SDK Manager with GUI interface. 唯一的问题是我还没有带GUI界面的SDK Manager。

You can install whichever android SDK or API from Intellij. 您可以从Intellij安装任何Android SDK或API。 I have the 2018.1 version but I hope this works in earlier versions too. 我有2018.1版本,但我希望这也适用于早期版本。 You can find the options to install the SDKs here: 您可以在此处找到安装SDK的选项: 在此输入图像描述

You can download the android SDK from this link here . 你可以在这里从这个链接下载android SDK。 I hope it should be helpful that link. 我希望链接应该有用。

First of all make sure you'be setup JDK properly. 首先确保你正确设置JDK。 If not, you can download it from here . 如果没有,您可以从这里下载。 Now go to Android Developer official site and download Android Studio. 现在去Android Developer官方网站下载Android Studio。

If you are already done with above mentioned points the few point you might be missing. 如果您已完成上述要点,那么您可能会遗漏几点。

  • When asked to choose the JDK (not SDK) you need to choose the Java JDK which you've installed earlier. 当要求选择JDK(而不是SDK)时,您需要选择之前安装的Java JDK。 Should be under C:\\Program Files\\Java\\jdk{version} 应该在C:\\ Program Files \\ Java \\ jdk {version}下
  • Choose a New platform ( if there's not one selected ) , the SDK platform is the android platform at C:\\Program Files\\Android\\android-sdk-windows. 选择一个新平台(如果没有选择一个),SDK平台是C:\\ Program Files \\ Android \\ android-sdk-windows下的android平台。

Please let me know if it didn't help. 如果它没有帮助,请告诉我。

Reference: https://www.jetbrains.com/help/idea/2017.1/getting-started-with-android-development.html 参考: https //www.jetbrains.com/help/idea/2017.1/getting-started-with-android-development.html

I had the same issue. 我遇到过同样的问题。 I tried downloading sdk via android eclipse setup process. 我尝试通过android eclipse安装程序下载sdk。 Eclipse automatically downloads the sdk. Eclipse自动下载sdk。 This sdk has a gui sdkmanager and can be used in idea as well. 这个sdk有一个gui sdkmanager,也可以在想法中使用。 Here is the link to download eclipse. 这是下载eclipse的链接

(Android Studio installed on my computer.) As i see users missed a point while installing android SDK. (Android Studio安装在我的电脑上。)因为我看到用户在安装android SDK时错过了一点。 You should show the Android SDK at AppData folder to IntellijIdea. 您应该将AppData文件夹中的Android SDK显示为IntellijIdea。 C:\\Users\\Your_Username\\AppData\\Local\\Android\\SDK_Folder. C:\\ Users \\用户Your_Username \\应用程序数据\\本地\\的Android \\ SDK_Folder。 References: https://www.jetbrains.com/help/idea/prerequisites-for-android-development.html https://www.jetbrains.com/help/img/idea/2017.2/AndroidSDKManager.png 参考文献: https//www.jetbrains.com/help/idea/prerequisites-for-android-development.html https://www.jetbrains.com/help/img/idea/2017.2/AndroidSDKManager.png

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

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