Windows 10 WSA Build Error

When trying to build my app within Unity it will build all the scenes and then fail at the end with the Error:

We have been able to make a build before but now whenever we try to we get this error. There doesn’t seem to be any information about this that we can find and it is currently blocking us from moving forward with our project.

Thank you for any information

This is definitely a bug in our build pipeline. Could you report it?

In the mean time, let’s try finding a workaround. Do you happen to have multiple managed assemblies/winmd files that are named the same in your project, and that are marked as compatible with windows store?

I submitted a bug report to Unity with #900588.

As for the assemblies, I don’t have any winmd files in my project and any plugins that are name the same are not both marked for Windows Store. Do I need to have winmd files in my project for it to build?

You don’t need any .winmd files (they’re just plugins like .dll files).

Unfortunately you did not attach any project to the bug report. Does it only happen on your main project, or can you reproduce this anywhere else?

Good news, I managed to fix that problem as far as I can tell. It was related to a plugin using a placeholder on the import settings. I don’t know how this would cause the problem but I am no longer failing a build with that error.

Now I have this error but I believe it is due to a plugin that we have using calls that are not in the current .Net framework:

“Failed to resolve assembly: ‘Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’”

This error is weird - this file is part of Windows 10 SDK. Is this folder present on your machine: “C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract”?

I checked to see if I have that file and I do not. Where would I get this file from?

It comes from Windows 10 SDK. You can go to Control Panel → Programs & Features → Microsoft Visual Studio 2015 → Change → Modify and it will be next to “Tools for Universal Windows Apps” or something like that.

Hey Tautvydas,

With some investigating I updated my Unity to 5.5.1p4 and all those issues seem to have cleared up. It seems that these were issues related to 5.5.1f1.

Thank you for your help!

Hello, I encountered a very similar error, but I am not sure how to solve it…

IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:337)
PostProcessWinRT.RunSerializationWeaver () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:498)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:149)
UnityEditor.WSA.BuildPostprocessor.DoPostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:155)
UnityEditor.WSA.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:162)
UnityEditor.HostView:OnGUI()

What Unity version are you on?

I am using Unity 5.6.1f1. FYI; I deleted both App and UWP folders before I started building.

Can you record a trace of the build failing like that using Windows Performance Recorder (steps on how to do that are here) with “File I/O activity” checkbox checked, and then send me the resulting .etl file via PM after zipping it up?

it’s beyond my comprehension. When I try to record the error using the Windows Performance Recorder, the error doesn’t occur and Unity builds it successfully. When I don’t use the WPR, the error comes back…

Whoa, that’s weird. Do you have any kind of 3rd party anti virus software or computer monitoring software that’s running in the background and could be interfering?

now the WPR is my go-to app to deal with this issue, lol. used it many times already.

Has this problem ever been solved or does anyone know of a workaround? I have not tried the WPR workaround mentioned above as I am not familiar with that level of Windows tooling (and it seems the tool is deprecated form MS - at least it says the page isn’t maintained anymore). I feel I have tried a million things (different directories, different drives, different templates for the build,…) and once in while (maybe every 10th or 20th time) it makes a build. But then after that the same settings will not produce a build again. So I haven’t found any consistency as to when those builds succeed and fail.

I am running Unity Version 2018.2.16f1 and the error message I get is this:

IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:337) … plus more.

Any guidance on how to address this?

Thanks for any help you can provide!!

WPR tool wasn’t a workaround - it’s a tool to record system level events (I wrote about it in more details here: https://files.unity3d.com/zilys/ETWPerfGuide/data/AnalyzingPerformanceUsingETW.html). The reason I asked for it was so I could pinpoint where the issue was. The tool isn’t deprecated - it’s part of the newest windows SDK. If you recorded a trace and PMed it to me, I could see why the builds are failing on your machine. The reason it worked around the issue for MatrixInception was pure coincidence.

Super - thanks for the feedback. I will try to create a trace and get back to you. Thanks again.

Just FYI - I sent you a PM …