Lorans-9847 avatar image
0 Votes"
Lorans-9847 asked VittorioLeo-6322 published

Unable to deply hololens app via Unity

I am using MRTK 2.7.2 and unity 2020.3.16f1.
I used the MRTJK Feature tool to import the MRTK package and configure the project.

I followed the project configurations in here ( and I build a big project but I couldn't deploy it using Unity "Build and Run on Remote Device". I tried to build the app using VS, it deployed but I was seeing the spatial awareness mesh and the app was pretty leggy.

I decided to start a new project following the same project setup instructions and I added only one cub. I tried to build and run the app from Unity but it didn't work either. It goes through the entire process then it gets stuck at "running" for one min then I get the following errors;

BuildFailedException: Deployment failed.
Output:Starting Appx installation...
Attempting to query installed packages matching app
Successfully retrieved installed packages matching app from the device
Copying: SAware_1.0.0.0_ARM64.appx
Failed to install SAware_1.0.0.0_ARM64.appx: Copying: SAware_1.0.0.0_ARM64.appx
Installation of Appx failed!
Installation failed in phase Idle - last status: Failed to install SAware_1.0.0.0_ARM64.appx: Copying: SAware_1.0.0.0_ARM64.appx
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at DevicePortalTool.AppOperation.ExecuteInstallAppx(ParameterHelper parameters, String appxFile, String certificate)
at DevicePortalTool.AppOperation.ExecuteInstallOperation(ParameterHelper parameters)
at DevicePortalTool.AppOperation.ExecuteOperationInternal(Operation op, ParameterHelper parameters)

ExitCode: -1 (OperationFailed)

ApplicationLauncherImpl.RunOnDevicePortalDevice (System.String appxPath, System.String playerPackage) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:440)
ApplicationLauncherImpl.Run (Utility+VisualStudio vs) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:360)
ApplicationLauncher.BuildAndRunProject (UnityEditor.Modules.BuildLaunchPlayerArgs args, UnityEditor.WSABuildAndRunDeployTarget deployTarget, System.String platform, Utility+VisualStudio vs) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:71)
ApplicationLauncher.BuildAndRun (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:39)
UnityEditor.UWP.BuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:78)
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <ef3b6bf002d8435a97b4e938f6c49b02>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Build completed with a result of 'Failed' in 405 seconds (404736 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <ef3b6bf002d8435a97b4e938f6c49b02>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <ef3b6bf002d8435a97b4e938f6c49b02>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HernandoRen-MSFT avatar image
0 Votes"
HernandoRen-MSFT answered VittorioLeo-6322 published

Hello, Welcome to Microsoft Q&A,

Since the MR app is a UWP app, "Build and Run on Remote Device" is not support deploying the MR app to HoloLens in Unity directly. We always build the Unity project first, and after it has finished, navigate into the folder that contains your newly-created solution file and find the solution file located inside this folder and open it with visual studio. For more information please refer to this link: Build and deploy to the HoloLens

If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks HernandoRen_MSFT for the prompt answer.
Actually I have made a few simple HoloLense 2 apps and I never deployed them via VS. I have always deployed them directly from Unity and I found that the to be the easiest way. You only have to give it the IP address, user name and a password and it does everything in the background. This is the first time I get this type of error.

0 Votes 0 ·

Hey @Lorans-9847, it sounds like you're referring to MRTK's Build Window. It automates the process of building a Unity project, generating a Visual Studio solution(.SLN), & UWP App package(.APPX), and installing the app package on the device. The MRTK Build Window was created because of the Visual Studio limitation that @HernandoRen-MSFT mentioned above.

Hopefully that clears things up for you.

1 Vote 1 ·

This looks like a new Build Window bug affecting the spatial awareness package. I'll open an issue on github for this. The MRTK engineers are currently on vacation for the holidays so they won't be able to take a look until January. In the mean time, @Lorans-9847, can you try following the deployment instructions that HernandoRen-MSFT posted above and let us know if that works for you?

Edit: Link to the github issue,

0 Votes 0 ·
Show more comments