• Android Emulator stays black on Xamarin Forms Apps

    Suddenly Android Emulator does not work on my Xamarin Forms Project anymore. Don’t know why, but Xamarin only says “Starting Android_Accelerate_x86”, Android Emulator pops up but stays black and nothing happens….

    I’ve searched forums and found some posts but none of them helped. So I just tried to start the Emulator without any application deployment. In Xamarin Studio you could use “Tools” -> “Devices” (in the Android section) .

    In the new window select your device and click “Start Emulator”.

    In my case, here also the Emulator just shows a blank screen. So problem is not related to Xamarin Forms or Xamarin Studio or my Xamarin App.

    So I started Android Virtual Device (AVD) Manager, available in Xamarin Studio at “Tools” -> “Google Emulator Manager”.

    Select your device, e.g. “Android Accelerated x86” and click “Start”. A new window appears. And now here is the important step: Tick the checkbox “Wipe user data”! In my case this fixed the problem and Android Emulator starts fine now!

    Great! So now I could debug my app with Xamarin Studio again….. Hmm… Now the Emulator opens fine, but my app does not work anymore. “Unfortunately, YourApp has stopped.” …. ? OK, closed Xamarin Studio and created a new blank project. Compiled fine. Now running on Android…. “Unfortunately, Testapp has stopped.”

    No further error messages….. hm….

    In this thread, it is proposed to disable Android Build Option “Use Shared Mono Runtime” so I tried that. The same result is received if you just switch from “Debug” to “Release” because shared mono runtime is not in use on release builds.

    Now the emulator does not come up anymore, but the following error message is shown:

    Deploying package to ’emulator-5556′
    The package does not support the device architecture (x86). You can change the supported architectures in the Android Build section of the Project Options.
    Deployment failed. Architecture not supported.

    Searching for this error message shows this thread containing the tip to enable x86 in the advanced build options of Android Project settings.

    And bam! Now it’s finally working fine!

    At least in release mode. Now trying in Debug Mode where all Supported ABIs are already ticked but leaving “Use Shared Mono Runtime” unchecked….

    But even though the emulator shows up, only the boot screen “Android” sign is shown and nothing happens. Xamarin Studio still says “Starting Android_Accelerated_x86” for minutes… And I could not even quit the emulator. I had to use the forced quit to stop it.

    And now, when I start my app again with release mode, it does not work again anymore…. So I have to start the emulator via AVD and select “Wipe personal data”. At least this does not happen every time, so as long as I stay in release mode it still compiles and displays fine….

    Anyway. Currently I’m fine with running Android in the release version. So the steps to get at least the release version running on Android Simulator are:

    • Start Emulator via Android Virtual Device Manager and select “Wipe personal data”
    • Switch mode from “Debug” to “Release”

     

    Very strange: Now I closed my testapp and opened another Xamarin Forms solution. It runs fine in release mode. I changed to debug mode, having “Use shared mono runtime” disabled. Error message: Architecture not supported. Ah fine, I have to enable x86 as shown above. And now it also runs fine in debug mode….? So I enabled “Use Shared Mono Runtime” which automatically ticks all ABIs, And it still works fine…. That’s now the same configuration as right at the start….

Leave a comment

If you want to share your opinion, leave a comment.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

  • Snazitup says:Reply
    August 10, 2017 at 21:58

    Kai! Thank you very much for this post; I was pulling my hair out for a while and couldn’t figure where I went wrong! Thanks again!

  • Mick says:Reply
    April 6, 2018 at 11:42

    you just saved my day man!