Why is the Android AVD Manager missing when using Android SDK in Intellij?
Asked Answered
A

5

11

I am trying to use the Android SDK in my IntelliJ project that is a larger project containing both web and ios clients as well as a server side (Thus that is why I'm not using Android Studio). I have installed on the Android SDK on my mac OSX machine. I ran the SDK Manager and installed Android 6.0 (API 23) as well as Android SDK Tools 25.1.7, Android SDK Platform-tools 23.1, and Android SDK Build-tools 23.0.1-24. I've also set up the Android SDK in my IntelliJ Project Structure. However, the Tools menu does not show the AVD Manager. This results in me being unable to select an emulator AVD when I create an Android Application Run/Debug Configuration. Specifically, the "Prefer Android Virtual Device" says "Unknown AVD" and there are no other options in that drop down and the "..." button is greyed out. How can I gain access to the AVD Manager without using Android Studio and simply using IntelliJ with the Android SDK installed? (Also, as you can see from the picture, my module is not specified, but that I believe is a separate issue) My Build Configuration

Ajax answered 16/6, 2016 at 5:3 Comment(1)
I referenced here jetbrains.com/help/idea/2016.1/managing-virtual-devices.html to determine that the AVD Manager should be accessible from IntelliJ Tools menuAjax
A
5

The answer to this for me (after I had followed all other steps to getting the proper SDKs installed) was simply the following:
In Intellij, File > open. Open the build.gradle file in the root level of the android project directory. In the popup that displays, select Open as Project. Then select your desired options in the dialog that appears. In short, the Android SDK Manager is only available when you've opened a project as an Android project.

Ajax answered 21/3, 2018 at 3:44 Comment(0)
L
20

The AVD Manager can be entered as follows: press Ctrl+Shift+A (Windows/Linux) or Cmd+Shift+A (mac), then enter avd and select the AVD Manager from the upcoming list (a similar approach works for other actions that are not easily found).

Lomax answered 19/2, 2019 at 15:44 Comment(0)
S
9

The answer to this question is very well hidden, far from being obvious and very puzzling implemented.

At my side this was caused by loading an old project with Java 7 and Android SDK 10, where the latter was no more available on my machine.

  • First, you must have all needed Java JDKs and the Android SDK installed. This is out of scope of this answer.
  • Second, you need to configure all of these into IntelliJ. This is probably what was missing at your side. Either the JDK or the Android SDK or all of them.
  • Third, you need to configure the proper Android SDK into your Project.
  • Fourth, you need to select the Emulator (it is configured with "Android SDK Manager", which was installed with the Android SDK in the first step) in the dialog.

First step

I cannot help you with that, sorry. Please find out yourself, how to download and install all the JDKs and the Android SDK for your platform.

Second step

To do the Second step, you probably want to go to "Default Project Structure" and add your Android SDK there. But to be able to do that, you need the proper Java JDK installed before! (Yes, this all is very very puzzling.)

To add all Java JDKs (Java 7, Java 8 and Java 9) each, do:

  • File :: Other Settings :: Default Project Structure...
  • Platform Settings :: SDKs
  • Press the green + :: JDK
  • Select the path where the JDK is installed. Select the directory, which contains the bin/ directory, not the bin/ directory itself.

Now that you have added all necessary JDKs, you start to select the Android API:

  • File :: Other Settings :: Default Project Structure...
  • Platform Settings :: SDKs
  • Press the green + :: Android SDK
  • Select the path where the JDK is installed. Select the directory, which contains the bin/ directory, not the bin/ directory itself.
  • Press OK, another window comes up.
    • This step fails if the needed JDK is not configured. The error message given can only be understood by people, who already know what to do. This is why you should always have all possible Java JDKs configured in IntelliJ.
  • Select the Android SDK you want to add.
  • You probably want more than one SDKs added, in case you want to create Apps for different minimum SDK versions. For this repeat this whole process.

Third step

Go to the Project Structure and set the Project SDK to the installed Android SDK:

  • File :: Project Structure... (or press Ctrl+Alt+Shift+s if the keyboard shortcuts still are on default)
  • Project Settings :: Project
  • Select the "Android API" you want to use under "Project SDK:"
  • You usually can leave everything else as it is

Fourth step

Now head over to "Run" :: "Edit Configurations...".

Now try to add the "Android App" again. If in the "General" Tab under "Deployment Target Options" with "Target:" set to "Emulator" nothing shows up in the dropdown of "Prefer Android Virtual Device:", then you need to configure/download some emulated devices through "Android SDK Manager".

If you are puzzled what that is and where to find it, have a look into the directory where you installed the "Android SDK"

At my side it is named tools/android.

  • You first need to download all needed emulator binaries there. Please ask "Marjory the Trash Heap", aka. Google, how to do this and what you need.

  • Also you need to configure some emulators. This, again, is very well hidden in the Menu of "Android SDK Manager":

    • Tools :: Manage AVDs...
    • Again, please use Marjory to find out what you need.

YMMV

Slemmer answered 10/10, 2017 at 9:56 Comment(2)
Thanks for this detailed guide. That fourth step is indeed important. If the currently opened project doesn't include the "Android App" configuration, there will be no Android option in the Tools menu. For IntelliJ, that option is dynamic based on the project configuration.Conan
This answer is spot on! I was missing Android SDK, but Intellij did now show me any error when I tried to open AVD manager. Shouldn't this be a bug?Budd
A
5

The answer to this for me (after I had followed all other steps to getting the proper SDKs installed) was simply the following:
In Intellij, File > open. Open the build.gradle file in the root level of the android project directory. In the popup that displays, select Open as Project. Then select your desired options in the dialog that appears. In short, the Android SDK Manager is only available when you've opened a project as an Android project.

Ajax answered 21/3, 2018 at 3:44 Comment(0)
F
0

(Using a React Native quickstart)

Make sure your module is selected when you create the run configuration in Android Studio.

Fauve answered 9/7, 2019 at 0:48 Comment(0)
M
0

I deleted the .idea folder at the root level of my project and re-opened the folder in IntelliJ, allowing IntelliJ to recreate the project (ensuring that the Android plugin was installed and enabled.) 

I think the problem was that when I initially opened the project IntelliJ built it from Gradle so didn't treat it as an Android project.

Marxist answered 9/1 at 21:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.