Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Android Emulator won't run application

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?

like image 269
MingMan Avatar asked Jul 25 '14 16:07

MingMan


People also ask

Why is my emulator not working Android Studio?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.

How do I enable Android Emulator in Visual Studio?

Just open up the Visual Studio Emulator for Android entry in your Start Menu, hit play, and the emulator is ready to debug from any IDE. Download the standalone emulator today!

What to do when emulator is not working?

If the emulator fails to launch due to the error vulkan-1. dll cannot be found , you probably need to update the emulator. To update the emulator in Android Studio, go to Tools > SDK Manager and install the latest stable version of Android platform.

How do I enable emulator in Visual Studio?

On the General tab, under Deployment Target Options change the Target option to "Open Select Deployment Target Dialog" and check the "Use same device for future launches" option, so that we can be prompted to select an emulator when we run a project in Android Studio: Go ahead and run your app.


4 Answers

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

like image 195
Diana Muturia Avatar answered Sep 25 '22 13:09

Diana Muturia


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/

like image 36
Phil Ryan Avatar answered Oct 17 '22 16:10

Phil Ryan


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

like image 5
Mateusz Moska Avatar answered Oct 17 '22 15:10

Mateusz Moska


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

like image 2
casillas Avatar answered Oct 17 '22 14:10

casillas