I create blank xamarin android project without add any code when i debug this project debugging without problem but when i run app with visual studio emulator for android emulator is running but not starting my app and deploy failed and don't show me error

why ? please help me

upvote
  flag
it can be due to many reasons, it there any error message, warning you can put it here for us in order to help you – Marzouk
upvote
  flag
don't show me warning just write deploy failed ... :| – m.h.bayan
upvote
  flag
i think visual studio can't run app in emulator – m.h.bayan
1 upvote
  flag
upvote
  flag
Do you have Windows 8 or higher? As far a i know i wont run under Windows 7. – Seb

8 Answers 11

up vote 39 down vote accepted

I had the same issue. VS 2015 can launch the VS emulator but can't deploy the app.

I was able to solve the issue like this:

  1. Launch the emulator (F5 in VS, then cancel the deployment using the Build/Cancel menu)
  2. Click on the chevron icon (») in the toolbar to the right of the emulator
  3. Select the Network tab
  4. Locate the preferred network ip address
  5. Back in VS, click on the Open Adb Command Prompt toolbar button
  6. Type adb connect [the emulator ip address]
  7. Press F5 again in VS

Looks like a VS bug to me.

upvote
  flag
I do but not solve my problem , why?:( – m.h.bayan
upvote
  flag
i install sdk manual possible for this ? – m.h.bayan
upvote
  flag
Exactly what I needed! – Chris Swain
1 upvote
  flag
Spent like a whole day trying to figure this one out. You're solution did it. – jdehlin
1 upvote
  flag
Thx for the answer. Worked for me! – Kenci
1 upvote
  flag
It also worked for me! Good Job! but need to do it in every deployment. – Janson
1 upvote
  flag
I cannot found chevron icon too. – Hareen Laks
1 upvote
  flag
Has anyone found a way to permanently fix this? – user400424
upvote
  flag
Worked for me but need a permanent fix – Dmitri Nesteruk

I had the same issue. It turned out the root cause was that the VS Emulator couldn't find adb.exe.

When that happens it won't connect to the emulator unless you do the manual connection following the steps CSharpRocks gives. The emulator also won't be listed under "adb devices".

The fix for me was to reinstall the Android SDK, using the Windows EXE based installer (not the zip installer). The EXE installer sets the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools key, Path value, in the registry, pointing to the Android SDK root directory.

The VS Emulator uses that registry setting (or the Android Studio install registry setting) to find the SDK, assuming you didn't install the Android SDK with Visual Studio itself. With that, it should be able to find adb.exe and work.

upvote
  flag
This was the same method that suggested by Microsoft (This is the link) and it worked for me and solved the issue permanently. – Janson

I'm having a very similar issue. I have found two different kind-of-work-arounds, but have not yet figured out a full solution.

Start the emulator before trying to deploy to it

  1. Launch the Visual Studio Emulator for Android application from the start menu.

  2. Launch one of the available emulators via the green arrow

    Visual Studio Emulator for Android

  3. Attempt to again launch your application from visual studio, selecting the VS Emulator N-inch... emulator from the drop down menu

    Visual Studio Emulator List

For me for some reason the app still doesn't "launch" on the emulator, although it is installed. So I have to open the application menu and select my app. Additionally it will usually crash the first several times I try to open it, but eventually displays my single default label, Welcome to Xamarin Forms!.

Run the application in Ad-Hoc mode

  1. Before running the application, change the solution configuration (from the top toolbar next to the green "run" button) to Ad-Hoc.


The problem with both of these methods though is that I'm still not able to actually debug an application. I can run it, but my breakpoints are ignored and I think that will make finding bugs difficult once I actually start to write a real application.

I hope to update this answer once I figure out an actual solution.

upvote
  flag
Thanks so much - Starting the emulator before trying to deploy to it fixed it for me... – James

Have a look here:

Xamarin Forms Android App Crashes Running Debug with VS Android Emulator

  1. Start the Hyper-V manager
  2. Select the emulator you are trying to use
  3. Right-click, hit settings
  4. Click processor
  5. Click Compatibility
  6. Set checkbox “Migrate to a physical computer with a different processor version”
upvote
  flag
This was the answer that worked for me. Good effort. – Jools
upvote
  flag
This worked for me too. Thanks :) – Stu1986C

I had such issues before with the android SDK emulator, now I'm using Genymotion emulator instead of it, it is more light and faster and will be detected automatically by you VS once launched.

you can download the free version from here : https://www.genymotion.com/

and also you can download any device emulator.

Try it enabling Hyper-V and using a Visual Studio Emulator from android; that worked for me after a lot of attempts and research

I had the same problem yesterday. The problem appeared (probably) because I tried to start development after a long break. I updated VS and everything, but faced many issues.

Eventually you need to start fresh

  1. Make sure SDK for emulator points to the right place (HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools)
  2. Run Visual Studio with Administrator privileges
  3. Go to Hyper-V Manager and delete ALL Virtual Switches - let the system recreate them when needed. It will do it properly
  4. Delete all existing emulators and recreate them in Visual Studio. I even found a comment to name them without spaces - not sure if it is needed, but wouldn't hurt.

Doing all this helped me. But I was on the verge of reinstalling Windows 10 clean. I think lots of things and configuration changed and are no longer compatible.

I had the same issue but in my case it was not the registry. After doing a release build, I deployed the app to the emulator device in release mode which pushes the app to the device and then effectively "disconnects". This leaves a version of the app on the device which seems to block further attempts at debugging or deploying.

I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.

You could probably also manually start the emulator and say "wipe device" option so it starts fresh.

Not the answer you're looking for? Browse other questions tagged or ask your own question.