20

I made an Android Virtual Device. It runs on the SDK emulator using Intel HAXM. I was able to see it in Visual studio (debug devices drop down list) and debug my applications on it. This is great for when I don't have a physical device to hand. Then something happened!?! It refuses to show up now?

Over the last week I have tried (In no particular order):

  • Recreating my virtual device.
  • Reinstalling visual studio.
  • Reinstalling Android SDK.
  • Installing both of the above as an administrator.
  • Checking the SDK path in the windows registry.
  • Tried adb kill-server / start-server.
  • Checked that Adb can see the device - it can.
  • Tried uninstalling/reinstalling HAXM manually.
  • Made sure my project targets API of the emulator.
  • Made sure that the build active configuration matches the emulator.
  • Ended any other ADB processes using task manager (leaving just the one for visual studio).
  • Checked windows event log for any warnings/errors. Nothing.

I have read these. Also no joy...

Other info:

  • I am using Visual Studio 2015 Community.
  • Physical devices work and appear without fail in the devices drop down!
  • latest android SDK
Community
  • 1
  • 1
make_transition
  • 452
  • 1
  • 5
  • 12

9 Answers9

14

I had a similar issue using VS 2015 with Android Emulator Manager (AVD). I have to start my emulator from the Android Emulator Manager and then it will show up in the debug devices drop down list, but one day it didn't show up. Tools > Android > Restart Adb Server fixed it for me.

Chloe
  • 176
  • 1
  • 4
10

For me on VS 2017 it was a matter of my user not being an admin. The issue is that unless the ANDROID_SDK_HOME environment variable is set it will create a .android folder in the %userprofile% directory and visual studio uses that to look for emulated devices. But when AVD is run as an administrator it uses whatever admin profile you use for admin priveledges and uses the .android folder under that user for managing emulated devices.

Following the link shows a guide on how to set the environmental variable so that all users look in the same location for emulated devices.

https://www.mysysadmintips.com/windows/clients/761-move-android-studio-avd-folder-to-a-new-location

longlostbro
  • 528
  • 2
  • 7
  • 24
4

Similar issue here, I had a series of android emulators setup in Visual Studio 2015 Android Emulator Manager (AVD), but when I tried to run a xamarin.forms sample, none of the emulators I created were showing up in the debug targets drop-down.

What fixed it for me was to set the android project as StartUp Project manually (right-click project > set as startup project)

For some reason (bug/feature?) it doesn't suffice to just change the selected item from Visual Studio menu drop-down 'startup projects'. Hope this helps!

Quantum_Joe
  • 181
  • 5
3

After making sure that you have installed the required software properly (having the Hyper-V option checked in Windows Features, also enabled in BIOS) :

  1. Go to your project's properties by selecting the project in Solutions Explorer and clicking ALT+ENTER
  2. After that, make sure that the Minimum Android to target is greater than or equal to at least one of your Device Profiles in Visual Studio Emulator Manager.
roxhens
  • 508
  • 6
  • 22
  • 1
    For some reasons I deactivated some of the network devices used by Hyper V, and that was the reason the emulator was not showing up. I reactivated them, reboot, and all fine now. Your answer put me on the right tracks, thanks ! (VS 2017 here) – Pac0 Oct 15 '19 at 15:13
0

I had this problem and realised that the visual studio environment variable was pointing to: C:\ProgramData\Microsoft\AndroidSDK\25 & not 'C:\Program Files (x86)\Android\android-sdk' where I'd created my new AVD.

So, I simply changed that and... of course it didn't work.

However, all is not lost. Simply fire up the emulator in AVD Manager, and drag and drop the .apk file on top of it and it installs!

Jules
  • 4,319
  • 3
  • 44
  • 72
0

I've had similar issues in VS2015. A solution that worked for me was Tools> Android > Restart Adb Server as @chlochlofasho mentioned.

Another time, what worked was simply: Cleaning sln, rebuilding sln, and then just restarting VS

password
  • 471
  • 3
  • 12
0

Updating the android emulator and some other things in Android SDK Manager and then restarting the computer worked for me

icamn
  • 1
  • 1
  • 1
0

I ran into this problem when I unisntalled VS2019 after having installed VS2022. Apparently that screwed up the emulator installation. VS tried to repair it but failed to do so.

I figured out in order to fix it I had to go into Tools->Android->Android SDK Manager...->[Tools] and unticked Android emulator to uninstall it and then I ticked it again to reinstall it.

This almost worked. Now it complained about aapt2. So all I had to do then was to go into Android properties and tick Use incremental android packaging system (aapt2).

Elikill58
  • 4,050
  • 24
  • 23
  • 45
CrenshawDK
  • 317
  • 1
  • 10
0

I encountered a similar issue with VS 2022.

Despite having the emulator running, it was not displayed in the debug drop-down list.

A quick solution was to go to Visual Studio Installer and do the repair.

Repair option - screenshot

Jakub Wysocki
  • 431
  • 4
  • 4