1

I'm trying to build my first HoloLens app using Unity. I imported the MRTK and its features. I also connected the HoloLens through USB. As soon as I press "Build and Run" it provides 3 errors. My build settings for Universal Windows Platform are the following:

  • Target Device: HoloLens,
  • Architect: ARM (I also tried ARM64),
  • Build Type: D3D Project,
  • Target SDK Version: Latest Installed,
  • Minimum Platform Version: (all the versions give the same error),
  • Visual Studio Version: Latest Installed,
  • Build and Run on: USB Device,
  • Build Configuration: Release.

Regardless of the build settings, the following errors appear as soon as I press the "Build and Run":

BuildFailedException: Deployment failed.
Output:[22:13:39.766] Windows Phone Player Runner started.
[22:13:39.772] Connecting to device.
[22:13:39.788] An error occurred while running: Could not load file or assembly 'Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at Microsoft.SmartDevice.Connectivity.DatastoreManager..ctor(DatastoreConfiguration configuration)
   at Microsoft.SmartDevice.Connectivity.DatastoreManager.Get(Int32 localeId)
   at Microsoft.SmartDevice.Connectivity.Wrapper.ConnectivityWrapper12.GetCurrentPlatform(Int32 localeId)
   at WindowsPhonePlayerRunner.Program.GetDevice()
   at WindowsPhonePlayerRunner.Program.Run(String appxPath, RunnerFlags runnerFlags, IEnumerable`1 copyFilesTo)
   at WindowsPhonePlayerRunner.Program.Main(String[] args)
[22:13:39.788] Exiting Windows Phone Player Runner.

ApplicationLauncherImpl.RunOnPhone (System.String commandLine)
ApplicationLauncherImpl.Run (Utility+VisualStudio vs)
ApplicationLauncher.BuildAndRunProject (UnityEditor.Modules.BuildLaunchPlayerArgs args, UnityEditor.WSABuildAndRunDeployTarget deployTarget, System.String platform, Utility+VisualStudio vs)  
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <55729f52d042492e9efc384182ae2feb>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Build completed with a result of 'Failed' in 177 seconds (176835 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <55729f52d042492e9efc384182ae2feb>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <55729f52d042492e9efc384182ae2feb>:0 
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Michel Gokan Khan
  • 2,525
  • 3
  • 30
  • 54
Arsi
  • 163
  • 9

1 Answers1

1

From the build log, the "Windows Phone Player Runner" related output should be caused by two possible reasons:

  1. Incorrect Unity version.
  2. Build and Run on: USB Device setting

For Unity version, we recommend using the Unity 2020 LTS version for HoloLens 2 development: https://unity3d.com/unity/qa/lts-releases?version=2020.3

For Build and Run on setting, it the issue is caused by Build and Run on: USB Device setting, this is a known issue and won't fix by Unity. The best practice is, please switch to Local Machine and generate the Visual Studio Project. With the help of Visual Studio, you can deploy to your HoloLens 2 via wireless network or USB cable. See:

Franklin Chen - MSFT
  • 4,845
  • 2
  • 17
  • 28