Search code examples
androidvisual-studioxamarinhyper-vvisual-studio-emulator

Visual Studio Android Emulator Black Screen in Apps periodically


I'm currently beginning app development using Xamarin with Visual studio in a virtual machine (My actual PC doesn't support android Emulation but the server next door does).
Whenever I have the virtual android device (using Visual Studio Emulator for Android) open and am using or debugging apps I get a black screen for some unknown reason, I can stop this behaviour by clicking where the home back and app manager buttons would be and this returns me to the app.

After reading other questions and responses online I don't believe my issue is similar, many have issues with flat out black screens with no interactivity, whereas my issue is different.

Some specs:

  • Virtual Machine I am developing in:
    • Intel xeon E5 2630 v4 2.2Ghz
    • 12 GB dedicated to my machine
  • Android device:
    • 5" KitKat (4.4) XXHDPI Phone
    • API Level 19

If anybody knows what could be the cause of this issue and perhaps a solution, it would be greatly appreciated


Solution

  • I contacted Visual Studio Android Emulator Feedback to get an answer to my question, I got a reply saying that Microsoft do not officially support nested VM's as there is no dedicated GPU provided to the system.
    However there is a workaround which is disabling OpenGL, I tried this method myself but I find the emulator becomes rather slow and far less responsive. By the way disabling OpenGL is also unsupported.

    Disabling OpenGL

    In VMWare Fusion, under General settings, for the OS Type, you’ll need to change it from Windows 8.1 to “Hyper-V (unsupported)”. I would also suggest at least 2 processors and 4gb of ram (6gb is better depending on the Android VMs you want to run)

    In Windows, you’ll need to edit the c:\program files (x86)\Microsoft XDE\10.0.10240.0\skus\android\xdesku.xml file and remove the following line from the file: GuestDisplayProvider=”VsEmulator.OpenGLGuestDisplay”

    Source of Method