Visual Studio Android Emulator won't run application

37,233

Solution 1

Like the other commenters, this is most likely just a symptom of slow emulator on your machine. I'm running Xamarin-Android development on my 2010-era OSX machine in mavericks with 8GB RAM, and it is slow-slow-slow, but usable. Try to find the Intel x86 speeds improvements (look for HAXM) and you will find that the emulator will be much much faster.

And yeah, get a real handset and plug it in to your computer: always much faster than emulation.

later edit Get Genymotion for Mac OSX or for PC/Windows or PC/Linux. It's way way way faster than the other emulators. I have since found that this is as fast, or faster, than running the App on my connected Android phone. It's certainly simpler in not having to have the device plugged into one of my USB ports, and allows me to code and test on the train. http://www.genymotion.com/

Solution 2

Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB. I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node

I've created it manually and it worked.

enter image description here

UPDATE

Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well.

enter image description here

Solution 3

I had the similar issue, and then I deleted the existing device simulator and reinstalled again and it started working.

Solution 4

As I use a different SDK, in my case

Go to Tools > Options > Xamarin and set the Android SDK path.

Sometime Visual Studio changes this configuration;

Solution 5

2020 Update: I followed the most voted comment, however, with Visual Studio 2019 updated recently, the steps have changed a little. Here is what previously worked:

  1. WHAT WORKED BEFORE

"Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB. I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node I've created it manually and it worked."

WHAT TO DO INSTEAD

Nothing. Don't mess with the path.

  1. WHAT WORKED BEFORE

"Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well."

Previous instructions image

WHAT TO DO INSTEAD

a. Go to Tools located at the top of the VS window, Get Tools and Features, go to Individual components, using the search tool in the pop up box, search "emulator", once you get the result, make sure both Google Android Emulator (API Level 25)(local install) and Intel Hardware Accelerated Execution Manager (HAXM) (local install) are both checked.

b. Close the solution(s) and restart VS then reopen the solution(s).

c. To deploy the app on the emulator, click Start button to spin up the emulator, left click on your Android project, then click Deploy. You should be able to see your app on your emulator's app menu. Updated Instructions image

Share:
37,233
MingMan
Author by

MingMan

Updated on July 09, 2022

Comments

  • MingMan
    MingMan almost 2 years

    I recently got into Xamarin development. I have a lot of experience in Xcode making iOS apps and the iOS side was very straight forward. Now I'm trying to implement Android. I downloaded a Hello World example to get my bearings. When I run it I have no problems getting the simulator to show up (MonoForAndroid_API_10 and MonoForAndroid_API_12) but the actual application doesn't run, and does not show up anywhere on the simulator. Essentially whenever I use run or run with in Xamarin on Android, it pulls up a fully functioning, albeit empty simulator.

    How do I get my application to run on the emulator?

  • Jannie Theunissen
    Jannie Theunissen almost 9 years
    I have had a lot of joy using the awesome Xamarin Android Player. It's fast and it's free.
  • Phil Ryan
    Phil Ryan over 8 years
    @JannieT, I'm pretty sure that the Xamarin Android Player is a custom version of Genymotion, due to the extremely close parallel between the XAP sidebar and the Genymotion sidebar. But I agree that the XAP is a better choice for a Xamarin developer.
  • Phil Ryan
    Phil Ryan over 6 years
    Noting that even though Xamarin has deprecated the Xamarin Android Player, I still like it, probably more than the Visual Studio Emulator for Android. And if it isn't suitable, then go back to Genymotion genymotion.com
  • Rodrigo Caballero
    Rodrigo Caballero about 6 years
    The emulator was the problem. The latest update works fine for me. My problem was that I was using a Google emulator that looks like doesn't work fine with VS