Android Studio does not see the AVD

8.1k views Asked by At

I have a problem related to the Android Studio.

  1. I create AVD with Android Studio AVD Manager and its configuration looks like this

https://i.stack.imgur.com/0IEIg.jpg

  1. I go back on the previous screen where I am supposed to select this device as Prefer Android Virtual Device

https://i.stack.imgur.com/mURqt.jpg

As you can see the box is empty. If I try to run the deice via the Android Studio AVD Manager it just doesn't start. No error message or anything

If I try to run it via the AVD manager that goes with the android sdk it starts in a normal way, but then I can not upload my app to it, because Android Studio does not see it.

I have installed the following

  1. jdk-8u25-windows-x86 in the following location D:\Programs\Java\jdk1.8.0_25
  2. jre1.8.0 that goes with the package mentioned in point 1 in D:\Programs\Java\jre1.8.0_25
  3. android-studio-bundle-135.1641136 the Android Studio itself in H:\AndroidIDE\Android Studio
  4. SDK that goes with the package mentioned in point 3 in H:\AndroidIDE\sdk
  5. JAVA_HOME set to D:\Programs\Java\jdk1.8.0_25

When I create avd via AVD manager in Android Studio its location on my file system is H:\Users.android\avd\Nexus_5_API_21_x86.avd (Have in mind that my user files are directly stored in H:\Users without my username being part of the path

When I am creating AVD from Android Studio the standalone AVD manager that goes with the SDK can see this AVD. When I create the AVD from Android Studio AVD manager the AVD manager that goes with the SDK can see the image as well.

Still problem remains that my Android Studio can not see those AVD and I can not select them from the emulator list when I am configuring my Run configuration.

I have tried this configuration on two different OS Windows 7 64bit and Windows 7 32bit. The result remains the same (of course I have installed different packages to match the OS architecture)

I would be very grateful if someone can help me. Because so far this Google Android Studio is a total disappointment. Surprisingly frustrating to install and configure it

6

There are 6 answers

0
Sbonelo On

The reason why your device does not appear is because you have not selected an application:

What you should do is have an application open in your android studio: go to run select edit configuration on the left pane instead of Defaults like on your image, expand android application choose app and all your devices will appear.

EDIT

With that window open, on the General Tab, you have no module, choose app and your emulators will appear.

3
Piotr Kopczyński On

Is API of AVD appropriate for your project? Have you tried any other configurations?

Keep these points in mind when you are selecting a system image target for your AVD:

  • The API Level of the target is important, because your application will not be able to run on a system image whose API Level is less than that required by your application, as specified in the minSdkVersion attribute of the application's manifest file. For more information about the relationship between system API Level and application minSdkVersion, see Specifying Minimum System API Version.
  • You should create at least one AVD that uses a target whose API Level is greater than that required by your application, because it allows you to test the forward-compatibility of your application. Forward-compatibility testing ensures that, when users who have downloaded your application receive a system update, your application will continue to function normally.
  • If your application declares a uses-library element in its manifest file, the application can only run on a system image in which that external library is present. If you want to run your application on an emulator, create an AVD that includes the required library. Usually, you must create such an AVD using an Add-on component for the AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).

http://developer.android.com/tools/devices/index.html

0
choff On

I experienced this recently while trying to run an imported sample project in AS 3.1.4. I fixed it by right clicking on the project and selecting "Make Module 'project name'". After this my Run/Debug configurations was populated with a list of AVD.

0
Dmitry On

Click on the "Sync Project with Gradle Files" button to fix the issue.

0
1192805 On

Another possibility is localhost. Check event log for

Unable to open connection to: localhost/192.x.x.x:5037, due to: java.net.ConnectException: Connection refused

AVD is present after changing this back in /etc/hosts

127.0.0.1 localhost

0
cologne On

Open project structure (ctrl-alt-shift-s). On the left hand side choose: "project", then select the project SDK (the AVD you created before) on the right side. This will connect your project to the AVD.