Visual Studio 2017 Xamarin.Forms project not deploying

I am new to Xamarin. I used the Xamarin.Forms template to create a sample mobile solution in Visual Studio 2017. This process created four projects: Xamarin PCL, Xamarin Android, Xamarin.iOS, and Xamarin.UWP. Without making any changes to the generated solution, I am trying to run it.

The first problem is that when I install UWP as a starter project, the Windows emulator appears and works fine with the app. But when I try to do the same with Android, I get different errors at different times based on the environment changes I make. Finally, using visual studio android emulator, phone UI appears but not my app. In the background, I can see that Visual Studio completed the build process successfully without any errors, but the deployment process just hangs. I left the deployment to run overnight but still works in the morning. Here is my environment.

  • Intel i7 processor
  • Virtual technology enabled in BIOS
  • Windows 10 Education
  • 32 GB RAM
  • Hyper-V on Windows is disabled
  • ran "bcdedit / set hypervisorlaunchtype off" in the command window and rebooted.

I tried to install the above environment in various combinations, but none of them seemed to get the application working. When I use android emulator from android sdk the build process throws errors. The only emulator that even builds is the visual studio emulator. But the deployment hangs.

The second problem is that I have installed Android SDK versions 24 and 25. But in the emulator dropdown I can only see emulators at 23. I checked the install path in both visual studio and android sdk manager and they both point to the same installation folder. What do I need to create emulators for versions 24 and 25?

Again, I didn't make any changes to the generated solution in visual studio before running it. I've been doing this for the last three days and couldn't get it to work. Please, help.

+3


source to share


3 answers


Pulling my hair out over the past few days, I finally got a Xamarin.Forms Android app to show my page on an emulator. Thanks to all members for their suggestions. Ryan's suggestion helped a lot (I supported it, thanks Ryan) but did not solve my problem. I googled further and found a suggestion that asked to change the following settings which did it for me finally. So, if anyone else is stuck like me, do the following (in addition to cleaning and updating all packages):



  • Open your Hyper-V vm setting for your emulator (while the virtual machine is off).
  • Expand the processor node on the left and click Compatibility.
  • Now check the box "Switch to a physical computer with a different processor version" on the right.
  • Start your emulator in the Visual Studio Emulation Tool.
  • Now start debugging your Android project in VS using the same emulator already running.
  • After a delay (there is always a delay), your application will appear on the emulator. Yey !!
+4


source


I just installed Visual Studio 2017 (on Win10 15063.138) and found, like you, Xamarin projects won't deploy on Android. This is how I got started:

  • Everything in Android SDK Manager has been updated.
  • Installed new improved Android emulator from MS: https://www.visualstudio.com/vs/msft-android-emulator/
  • Used to download / install API Level 23 (6.0 Marshmallow) Emulator
  • Started this emulator using the same tool (you can see it works in Hyper-V Manager)
  • Chose the same emulator in VS for deployment / debugging (the emulators that ship with VS are painfully slow)
  • In VS, the selected Android project to run and test build and deploy in Android in the mgr config.


Note. MS doesn't have emulators above API level 23, so the compilation options and targets for your Android project might be the most recent, but the minimum target should be 6.0 (API 23).

+5


source


I just cleaned up the solution and rebuilt. Unrolled and it worked again. Deployed, has a coding error, but "runs" again. I hate this kind of problem. grrr.

0


source







All Articles