Xamarin.Android Projects failed to deploy emulator for Android in visual studio

I am using visual studio 2015 update 1 with windows 10 build 10586 TH1.

I also use Xamarin version 4.0.1.96.

I created an empty Xamarin.Forms application. It deploys Windows Phone emulators without any problems . But it was not possible to install emulators on Android.

When I launched the Android Android project , Emulator started successfully , but the visual studio freezes at this step.

I have tried many profiles of Android emulator but cannot solve the problem.

This problem exists only for emulators and a project successfully deployed on a physical Android device.

I have the same problem with Xamarin.Android projects.

Here is all the text in the output window:

  • 1> Deployment Launch 4.5 "KitKat (4.4) HDPI Phone ...
  • 1> Launching 4.5 "KitKat (4.4) Emulator HDPI Phone ...
  • 1> Checking emulator arguments ...
  • 1> Determining if the emulator is already running ...
  • 1> Preparing a virtual machine ...
  • 1> Starting the emulator ...
  • 1> Emulator started successfully

Thank you in advance for your help.

+7
android android-emulator xamarin xamarin.forms visual-studio-emulator
source share
8 answers

I ran into the same problem when the emulator started up, but Visual Studio freezes when building / deploying. Finally, it turned out from here .

Visual Studio is stuck trying to deploy the application in an emulator, or the emulator does not appear as a debug target in other IDEs

If the emulator is running, but it does not seem to be connected to ADB (Android Debug Bridge), or it does not appear in Android tools that use ADB (e.g. Android Studio or Eclipse), you may need to configure where the emulator is looking for ADB. The emulator uses the registry key to determine the base location of your Android SDK and looks for the \ platform-tools \ adb.exe file in this directory. to change the Android SDK path used by the emulator:

  • Open the registry editor by selecting Run from the Start context menu, typing regedit in the dialog box, and selecting OK.
  • Go to HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Android SDK Tools in the folder tree on the left.
  • Modify the Path registry variable to match the path to the Android SDK. Restart the emulator, and now you can see the emulator connected to the ADB and its associated Android tools.

The value in my registry has been set to "C: \ Program Files (x86) \ Android \ android_sdk" (or similar). Updating it for "C: \ Users \ {USERNAME} \ AppData \ Local \ Xamarin \ MonoForAndroid \ AndroidSDK" resolved it for me. (I have not yet been worried about how to make this work for all users.)

+10
source share

I had the same problem, but in my case it was not a registry. After creating the assembly, I deployed the application to the emulator in the release mode, which pushes the application to the device, and then effectively "disconnects". This leaves a version of the application on the device, which seems to block further debugging attempts.

I solved this by starting the emulator, going to "settings → applications" and manually deleting my application. Then the next build and debug deployment was launched again.

+1
source share

I had the same problem. After a long struggle, I fixed it.

Sol 1:

Refer to the registry as mentioned by others.

**HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools** 

Sol 2:

In my case, there is no tool for the Android SDK found in the registry. So, you must add the registry manually here "**HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node**"

you can add it by right-clicking **Wow6432Node** => **New** => **key** .

Set the key name as "Android SDK Tools" **, then right-click **Android SDK Tools** =>**New** => **String Value**

Set the name as **Path** for the newly added line. Then right click on **Path** => **Modify..**

Copy the Android SDK Tools path from the program files and paste these values .

Now the registry is created manually. You can debug a project through an emulator.

Note Do not forget to reboot the system.

+1
source share

Look at here:

Xamarin Forms removes Android applications running debug version with VS Android emulator

  • Launch Hyper-V Manager
  • Select the emulator you are trying to use
  • Right click, click settings
  • Click processor
  • Click "Compatibility"
  • Check the box "Transfer to a physical computer with a different version of the processor"

You do not have this problem on a laptop because its processor does not provide new features that are not supported by Android Emulator for Visual Studio. The described setup is required only for PCs with newer processors.

0
source share

I circumvented this issue by running Visual Studio as an administrator.

0
source share

I also had a weirdness with Visual Studio Emulator for Android, and the visual studio seemed to be stuck in the "Deploy ..." step, trying to run the debugging application. I found that restarting the emulator and visual studio seems better to me when it starts to do this. In addition, when debugging an application, it seems that exiting your application usually helps compared to using the "Stop Debugging" button. For example, I started my application twice and killed it using the “Stop Debugging” button, but I couldn’t deploy / launch the application 3 times without restarting the visual studio and the emulator. I am using VS 2015 Community Edition with Update 3.

0
source share

I had a very interesting experience,

In my case, the registry path to the SDK was correct,

I unchecked the "Use quick deployment" checkbox (in the packaging properties in the Android settings) and all my attempts to restart the computer, close VS, Close the emulator launch failed.

However, I did the following two:

1 - Updated all components in the android SDK manager and restarted the PC,

2 - disabled my antivirus! and then suddenly VS deployed the application to the emulator !! (He was stuck in the same situation when the emulator starts up and nothing happens!) I did it out of despair!)

(OS: Win 7, Professional Edition VS 2017 Community!)


More details

I tried this for three more days. For my special case, disabling Anti-Virus seems to solve the problem every time!

0
source share

The solution for me was to check the deployment window in Configuration Manager Enable Deployment

This answer came from the Xamarin Forum

0
source share

All Articles