Visual Studio - Xamarin - Emulator black screen/

Viewed 22088

I decided to install xamarin the other day so I could start coding in c#. So far it's been an absolute nightmare getting anything to work. I downloaded the xamarin bundle that visual studio offers and now I'm trying to simply run a test app and the emulator won't work.

I've looked at every video online, & tried to read through as many forums as possible but at this point I need direct help before I throw my computer into the pool(jk)

I've downloaded android emulator & installed almost all the devices & made sure to install all the packages in the android sdk. I created a new device from the vds manager but I STILL get errors. this is the message I get waiting for the emulator to start, I don't see the android splash either

still waiting

6 Answers

I got stuck on this for a while until the basic issue was I simply was not waiting long enough. Keep an eye on your Visual Studio build window, and watch all the slow messages as the come up.. it takes around 3-5 minutes on a blank project for the first time on a intel i5 with 8GB ram.... so the trick really in my case was to be patient. I think it gets faster second time round as it remembers some of the hard work it did the fist time to get it to work.

When you create an Android Emulator (this can be done in the Xamarin Android Device Manager in VS or selecting 'Create Android Emulator' in the dropdown on the Run button), there is an option named hw.gpu.mode. In my case (using Hyper-v), changing the option from auto to mesa did the trick, although there are a number of different options.

I enabled Hyper-V acceleration based on microsoft documentations: https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin&pivots=windows#accelerating-with-hyper-v

Basically you need to turn on these two windows features from the control panel (Turn windows features on of off):

  • Hyper-V.
  • Windows hypervisor platform.

then from visual studio go to: Tools >> Android >> Android SDK manager >> Tools >> make sure that "Android emulator" version is 27.0.1 or higher, if not, you will find in the same screen a button below to update it.

I did this on windows 10 64-bit, with VS 2017 Community 15.9.5

I just reseted the emulator to factory defaults and it worked. Reseting Android emulator in visual studio

June, 2022.

I know that this is kind of an old question, but I've had the same issue, which I fixed by updating the Visual Studio (2022).

Related