Unity 2022 UWP development build error

Hello guys,

I tried to build a UWP project with MRTK and OpenXR configurations and it seems that if I check the development build + script debugging options in the build menu I get this error:

I get this error even if I try to build an empty project (tried with Unity 2022.1.0a8 and 2022.1.0a12).

Stdout:
Error: IL2CPP error for method 'System.Boolean System.Runtime.InteropServices.WindowsRuntime.IBindableIteratorToIEnumeratorAdapter::System.Collections.IEnumerator.MoveNext()' in assembly '__Generated'
System.InvalidOperationException: Error while processing debug information. This often indicates that debug information in a .pdb or .mdb file is not correct.
Check the debug information corresponding to the assembly '__Generated'.
---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Unity.IL2CPP.MethodWriter.CollectSequencePoints(PrimaryCollectionContext context, MethodDefinition method, SequencePointCollector sequencePointCollector)
   --- End of inner exception stack trace ---
   at Unity.IL2CPP.MethodWriter.CollectSequencePoints(PrimaryCollectionContext context, MethodDefinition method, SequencePointCollector sequencePointCollector)
   at Unity.IL2CPP.AssemblyConversion.PrimaryCollection.Steps.PerAssembly.SequencePointCollection.ProcessItem(GlobalPrimaryCollectionContext context, AssemblyDefinition item)
   at Unity.IL2CPP.AssemblyConversion.Steps.Base.ScheduledItemsStepFunc`5.WorkerWrapper(WorkItemData`3 workerData)
   at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.ContinueWithResultsWorkItem`4.InvokeWorker(Object context, Int32 uniqueId)
   at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.BaseContinueWorkItem`2.Invoke(Object context, Int32 uniqueId)
   at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data)

   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <79e7264827bd431fb11de781f3b150c2>:0)
UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <79e7264827bd431fb11de781f3b150c2>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <79e7264827bd431fb11de781f3b150c2>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <79e7264827bd431fb11de781f3b150c2>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <79e7264827bd431fb11de781f3b150c2>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <79e7264827bd431fb11de781f3b150c2>:0)
PostProcessWinRT.RunIL2CPPForProjectBuild () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1903)
PostProcessWinRT.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1872)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:212)
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 <79e7264827bd431fb11de781f3b150c2>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <79e7264827bd431fb11de781f3b150c2>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Can you submit a bug report for this issue? This looks like a bug and we will investigate it.

I’ve just sent a bug report. Looking forward to the fix.

2 Likes

Hi @JoshPeterson , @adrian-lupsan has this bug been resolved ? thanks for the update

I don’t recall which bug report this is, so I can’t give a status update, sorry!

I believe it’s this one: Unity Issue Tracker - [UWP] Project fails to build when Development Build and Script Debugging options are ticked

1 Like

Hello

not resolved yet but it was addressed and…

yes, this is the one

1 Like

Thanks for pointing that one out @Tautvydas-Zilys ! Our team has corrected it, and a fix is on the way to Unity versions now.

1 Like

I’m running against this wall on Unity 2021.2.7f1, [EDITED] @JoshPeterson I’m using UWP methods (e.g. Storage) not in Unity’s APIs so can’t debug with the editor, the app is crashing when I build but logs don’t show much info to progress the app, what do I use until the update lands?

thanks a bunch everyone for the update :slight_smile:

1 Like

I can confirm this.
Unity 2021.2.7 can’t build an UWP build with “Script Debugging” enabled if a line of code like this one is used:

private static readonly List<StorageFile> lastOpenFiles = new List<StorageFile>();

It seems something with the List-implementation is wrong.

All I know is that it worked with Unity 2020.3.20 - please fix it.

1 Like

The fix for the issue landed in 2021.2.8f1 and 2022.1.0b3.

2 Likes