简体   繁体   English

Hololens 2 模拟器因其他原因而失败

[英]Hololens 2 emulator failed with Alternating reasons

So i have been building Windows Mixed Reality ToolKit (MRTK) example project in Unity, and than attempt to deploy it to the Hololens 2 emulator from the Visual Studio 2019 editor, but every time it failed to run for a different reasons.因此,我一直在 Unity 中构建 Windows 混合现实工具包 (MRTK) 示例项目,然后尝试从 Visual Studio 2019 编辑器将其部署到 Hololens 2 模拟器,但每次都因不同原因而无法运行。
Some of the times VS2019 failed to deploy completely with the error:有时 VS2019 无法完全部署并出现错误:

    Updating the layout...
TimeoutException: This operation returned because the timeout period expired. (Exception from HRESULT: 0x800705B4)
TimeoutException: This operation returned because the timeout period expired. (Exception from HRESULT: 0x800705B4)
DEP0600: Deployment failed. Failed to deploy through new deployment pipeline.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Another times the app deployed successfully but asked me for a weird microphone permission还有一次,应用程序部署成功,但要求我提供一个奇怪的麦克风许可
在此处输入图像描述 and after i approved, it immediately crashed with a runtime error:在我批准后,它立即因运行时错误而崩溃:

DEP6100: The following unexpected error occurred during bootstrapping stage 'Connecting to the device': NullReferenceException - Object reference not set to an instance of an object.

VS2019 didn't give me any useful information about those errors, which kept happening somewhat random and inconsistently. VS2019 没有给我关于这些错误的任何有用信息,这些错误一直在随机且不一致地发生。
I have tried googling those errors but nothing useful came up for 2 days.我曾尝试用谷歌搜索这些错误,但 2 天都没有找到有用的信息。

These are my tools这些是我的工具
Machine: Dell XPS13 Unity version: 2021.2.14f1机器:Dell XPS13 Unity版本:2021.2.14f1
MRTK version: 2.7.3 MRTK 版本:2.7.3
Visual Studio Community 2019 version: 16.11.9 Visual Studio Community 2019 版本:16.11.9
Hololens 2 Emulator version: 10.0.20348.1450 Hololens 2 模拟器版本:10.0.20348.1450
(Now i will answer my own question) (现在我会回答我自己的问题)

So after poking around for 2 days, playing with MRTK versions, Unity versions, VS versions, Hololens 2 emulator versions, i have realized that the problem is laying with the extremely long loading time of the Hololens 2 emulator (~15min) which is causing some "timeouts" in VS2019 deployment process所以在摸索了 2 天,玩过 MRTK 版本、Unity 版本、VS 版本、Hololens 2 模拟器版本后,我意识到问题出在 Hololens 2 模拟器(~15 分钟)的极长加载时间,这导致VS2019部署过程中的一些“超时”
So at first i tried opening the emulator before i deploy the app in Visual Studio, but that didn't help since VS2019 opens its own instance of Hololens 2 Emulator.因此,起初我尝试在 Visual Studio 中部署应用程序之前打开模拟器,但这并没有帮助,因为 VS2019 打开了它自己的 Hololens 2 模拟器实例。
Eventually what solved the issue was to deploy as usual (green triangle), letting VS2019' Hololens 2 Emulator instance boot, and than waiting some ~15 minutes until the VS19 is giving a "Deployment failed" error.最终解决问题的方法是像往常一样部署(绿色三角形),让 VS2019 的 Hololens 2 模拟器实例启动,而不是等待大约 15 分钟,直到 VS19 给出"Deployment failed"错误。
Than VS will pop up a dialog saying "error. do you want to continue?"比 VS 会弹出一个对话框说“错误。你想继续吗?” and select NO.和 select 号。
Don't close the Hololens 2 Emulator.不要关闭 Hololens 2 模拟器。
After that run it again (green triangle) - this time the deploy will succeed, but it will be followed by a runtime error.之后再次运行它(绿色三角形)——这次部署将成功,但随后会出现运行时错误。
Press the red square to stop the run, and most importantly don't close the emulator.按红色方块停止运行,最重要的是不要关闭模拟器。
Now try to deploy for the third time - it will take ~2min and it will run as expected.现在尝试第三次部署 - 大约需要 2 分钟,它会按预期运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM