3

I am trying to learn more about Xamarin in my spare time. I am having problems at every single step and sub step of the way. I am spending all of my time troubleshooting issues with Emulators and the SDK along the way. No time for development.

My current issue is that the Android Emulator hangs at the "Emulator launched successfully." stage i.e. the Emulator is launched, but the application is not deployed. It is so very frustrating. Why is the app not deployed. So far (I have spent a lot of time):

1) Reinstall VS 2017.
2) Reinstall Visual Studio Emulators for Android.

I have spent so much time on this. Is there anything else I can try?

w0051977
  • 15,099
  • 32
  • 152
  • 329
  • For performance and save time, you can test the app on a real device, take a look at [How do I debug on a real android device using Xamarin for Visual Studio?](https://stackoverflow.com/q/25192573/4977870) and [Set Up Device for Development](https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development) – Anas Alweish Oct 08 '19 at 20:58
  • For your question, maybe the answers on the question [Xamarin.Forms Visual Studio 2017 project does not deploy](https://stackoverflow.com/q/43344203/4977870) will help you – Anas Alweish Oct 08 '19 at 21:06
  • @Anas Alweish, I have answered my own question. Thanks. – w0051977 Oct 09 '19 at 13:15
  • In Visual Studio 2019 > Tools > Android > Android SDK Manager - select the (Gear?) icon in the lower right corner to change Repository from "Microsoft (Recommended)" to "Google (Unsupported)" and reinstall (uninstall - then install), for example, the platform API level component (Android SDK Platform version and System Image). This might solve problems with some older Android API levels below 8. For the latest (8/9) the Microsoft repository should probably be used. Currently for 10, the Google repository should be used. – Benl Oct 11 '19 at 12:26

2 Answers2

0

VS 2017 is much older and there have been several issues users have been facing. Uninstall VS 2017 and Install VS 2019 instead. Once you have that, and in the unlikely event that you are still facing issues, change your log verbosity to Diagnostic and share the error message.

Occasionally Android emulators created by VS may not work properly, in that case try to use an actual device, or create an emulator using Android Studio (you will have to install Android studio for that)

Saamer
  • 4,687
  • 1
  • 13
  • 55
  • You can change the verbosity of your log via Tools > Options > Projects and Solutions > Build and Run – bachph Oct 09 '19 at 06:48
0

I managed to get past this error by doing the follow (copied from here: Xamarin "Waiting for runtime checks to complete" and VS Emulator):

1) Build and Run the application 
2) The build will stall with at "Waiting for Runtime Checks" 
3) In the emulator click the ">>" arrows in the tool-bar to the right 
4) Make a note of the IP address for the Windows Phone Emulator Internal Switch 5)
5) Back in VS. From the menu select Tools->Android->Android ADB Command Prompt 
6) Type "adb connect [IP_FROM_STEP_#4]" 

The build continued.

w0051977
  • 15,099
  • 32
  • 152
  • 329