UWP build failing when Copying Resources

These are the 2 errors I get.

  1. This one says 13 errors. There are no 13 errors as far as I can see.
    What could this be?

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

02.As far as I know there is no such thing with an empty filename…

ArgumentException: An empty file name is not valid.
Parameter name: sourceFileName
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <9577ac7a62ef43179789031239ba8798>:0)
System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at <9577ac7a62ef43179789031239ba8798>:0)
PostProcessWinRT.CopyTestCertificate () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1579)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:185)
UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:86)
Rethrow as BuildFailedException: Exception of type ‘UnityEditor.Build.BuildFailedException’ was thrown.
UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:90)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <1e441e8684a14fe4b8f8a926d91afc3a>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <1e441e8684a14fe4b8f8a926d91afc3a>:0)
UnityEngine.GUIUtility: processEvent(Int32, IntPtr, Boolean&)

In the UWP player settings, what is the certificate field configured to?

It is configured using a certificate I created with Unity.

(Which gives me trouble down the line in Visual Studio but is the only way I could make it build properly.)

6781391--784940--upload_2021-1-30_1-48-1.png

Could you try recreating it? For some reason it seems the path to it is empty or corrupted.

It happened several times in a row.
In general, I never post about something with a single incident. Has to be over 4-5 times of failure and attempts to fix it, before I make a post.

Does that mean it’s not happening every time you build?

It happens every time in Unity. Older versions too. (i.e. 2018 and 19 series)
Then I start the project in VS and associate the build with the Windows Store product that I have already published so the new build from VS uses the store certificate and builds properly.

Can you report a bug report on that? You should be able to delete all the assets in your project except the offending certificate before submitting it.

1 Like

I suppose I could also do it in an empty project with a template scene. I do not have reasons to believe it would not happen the same. It happens on all the projects. Not just that one.

The problem for the end user is that there are workarounds, (like in the case with the dedicated GPU in UWP)
And when there are workarounds usually teams do not bother much; even though the workflow is broken.

Teams often take for granted (and that applies for Unity too) that the user will eventually get to know about the workaround and perform their tasks. While from my perspective (as producer and product manager) the problem is that there are countless hours lost on silly issues and that people get to generate support/QA tickets again and again, over trivial matters that could have been resolved from the engine side.

I wouldn’t ask you for a bug report if I wasn’t interested in fixing it. My team is responsible for that piece of product. If you report a bug and give me the case number, I’ll make sure it’s handled properly.

1 Like

For the sake of testing,
I setup a brand new empty project with the default HDRP Template in Unity 2020.2.2f1.

Even this comes with its own set of issues.

Default UWP Release Build in VS2019 - Without Copying References (cert with password)


Cert without password

Unity Console + Build and Play with Copy References On

6801272--788810--upload_2021-2-4_11-47-22.png

Debug Build

Unlimately when the build successfully deployed, It would not function properly.
The app started but was stuck on the splash screen.

I will be preparing my project for a bug report the next days.

After cleaning up all the assets and tools the error is similar to the empty scene.

This is with “copy references” disabled
6802592--789053--upload_2021-2-4_15-49-54.png

This is with copy references enabled.
6802592--789056--upload_2021-2-4_15-51-37.png

The previous error is now gone, but same as above happens in the actual project.

6802592--789110--upload_2021-2-4_17-13-33.png

6802592--789113--upload_2021-2-4_17-14-33.png