Xamarin.Forms Visual Studio 2017项目未部署 [英] Xamarin.Forms Visual Studio 2017 project does not deploy

查看:256
本文介绍了Xamarin.Forms Visual Studio 2017项目未部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Xamarin的新手.我用过Xamarin.表单模板,以在Visual Studio 2017中创建示例移动解决方案.该过程创建了四个项目Xamarin PCL,Xamarin Android,Xamarin.iOS和Xamarin.UWP.在不对生成的解决方案进行任何修改的情况下,我正在尝试运行它.

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

第一个问题是,当我将UWP设置为启动项目时,Windows模拟器会显示并完美运行该应用程序.但是,当我尝试对Android执行相同操作时,会根据我所做的环境更改在不同时间出现不同的错误.最后,使用Visual Studio Android模拟器显示Phone UI,但不显示我的应用程序.在后台,我可以看到Visual Studio成功完成了构建过程,没有任何错误,但是部署过程只是挂起了.我让部署在一夜之间运行,但仍在早晨运行.这是我的环境.

The first issue is, when I set the UWP as the starting project, the Windows emulator shows up and runs the app perfectly. 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 the visual studio android emulator, the Phone UI shows up but not my app. In the background, I can see that Visual Studio completed the build process successfully without any errors but the deploy process simply hangs. I left the deploy running overnight but still running in the morning. Here is my environment.

  • 英特尔酷睿i7处理器
  • 在BIOS中启用虚拟化
  • Windows 10教育版
  • 32GB RAM
  • 在Windows中禁用了Hyper-V
  • 在命令窗口中执行bcdedit /set hypervisorlaunchtype off,然后重新启动.
  • Intel Core i7 processor
  • Virtualization enabled in BIOS
  • Windows 10 Education
  • 32GB RAM
  • Hyper-V disabled in Windows
  • Executed bcdedit /set hypervisorlaunchtype off in the command window and rebooted.

我尝试将上述环境设置为不同的组合,但似乎没有一个使该应用程序正常工作.当我使用来自android SDK的android模拟器时,构建过程会引发错误.甚至可以构建的唯一模拟器是Visual Studio模拟器.但是部署挂起了.

I tried setting the above environment in different combinations but none of them seem to make the app work. When I use an android emulator from android SDK, the build process throws errors. The only emulator that even builds is the visual studio emulator. But the deploy hangs.

我遇到的第二个问题是,我已经安装了版本24和25的android SDK.但是在模拟器下拉列表中,我只能看到23的模拟器.我在Visual Studio和android SDK Manager中都检查了安装路径,它们都指向同一个安装文件夹.我需要什么才能使版本24和25的仿真器可用?

A second issue I have is, I have installed android SDK for version 24 and 25. But in the emulator dropdown, I can only see the emulators for 23. I checked the installation path both in visual studio and android SDK manager and they both point to the same installation folder. What do I need to make the emulators for version 24 and 25 usable?

我再说一遍,在运行Visual Studio之前,我没有对生成的解决方案进行任何更改.在过去的三天里,我一直在努力,无法使其正常工作.请帮忙.

I repeat, I did not make any change to the generated solution in visual studio before running it. I have been at it for the past three days and couldn't make it work. Please help.

推荐答案

过去几天拉了我的头发,我终于有了Xamarin.Forms Android应用程序,可以在模拟器上显示我的页面.感谢所有成员的建议.瑞安的建议大有帮助(感谢瑞安,我为他+1了),但并没有解决我的问题.我在Google上进行了进一步的搜索,发现了一条建议,要求更改以下设置,最终完成了对我的设置.因此,如果其他人像我一样陷入困境,请执行以下操作(除了清理和更新所有程序包):

After pulling my hair for the past few days, I finally got my Xamarin.Forms Android App to show my page on the emulator. Thanks to all the members for their suggestions. Ryan's suggestion helped a lot ( I +1ed him, thanks Ryan) but did not solve my problem. I googled further and found a suggestion that asked to change the following setting which did it for me finally. So, if anyone else get stuck like I did, please do the following (in addition to cleaning up and updating all packages):

  • 为您的模拟器打开Hyper-V虚拟机的设置(在虚拟机关闭的情况下).
  • 展开左侧的Processor节点,然后单击兼容性".
  • 现在,在右侧的迁移到具有不同处理器版本的物理计算机"上打勾.
  • 在Visual Studio模拟器工具中启动模拟器.
  • 现在,使用已在运行的同一模拟器开始在VS中调试android项目.
  • 延迟(总是存在延迟)后,您的应用程序将显示在模拟器上.是的!

这篇关于Xamarin.Forms Visual Studio 2017项目未部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆