Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Unity 2022 UWP development build error

Discussion in '2022.1 Beta' started by adrian-lupsan, Oct 27, 2021.

  1. adrian-lupsan

    adrian-lupsan

    Joined:
    Jul 4, 2016
    Posts:
    9
    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).

    Code (CSharp):
    1. Stdout:
    2. Error: IL2CPP error for method 'System.Boolean System.Runtime.InteropServices.WindowsRuntime.IBindableIteratorToIEnumeratorAdapter::System.Collections.IEnumerator.MoveNext()' in assembly '__Generated'
    3. System.InvalidOperationException: Error while processing debug information. This often indicates that debug information in a .pdb or .mdb file is not correct.
    4. Check the debug information corresponding to the assembly '__Generated'.
    5. ---> System.NullReferenceException: Object reference not set to an instance of an object.
    6.    at Unity.IL2CPP.MethodWriter.CollectSequencePoints(PrimaryCollectionContext context, MethodDefinition method, SequencePointCollector sequencePointCollector)
    7.    --- End of inner exception stack trace ---
    8.    at Unity.IL2CPP.MethodWriter.CollectSequencePoints(PrimaryCollectionContext context, MethodDefinition method, SequencePointCollector sequencePointCollector)
    9.    at Unity.IL2CPP.AssemblyConversion.PrimaryCollection.Steps.PerAssembly.SequencePointCollection.ProcessItem(GlobalPrimaryCollectionContext context, AssemblyDefinition item)
    10.    at Unity.IL2CPP.AssemblyConversion.Steps.Base.ScheduledItemsStepFunc`5.WorkerWrapper(WorkItemData`3 workerData)
    11.    at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.ContinueWithResultsWorkItem`4.InvokeWorker(Object context, Int32 uniqueId)
    12.    at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.BaseContinueWorkItem`2.Invoke(Object context, Int32 uniqueId)
    13.    at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data)
    14.  
    15.    at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
    16. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <79e7264827bd431fb11de781f3b150c2>:0)
    17. 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)
    18. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <79e7264827bd431fb11de781f3b150c2>:0)
    19. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <79e7264827bd431fb11de781f3b150c2>:0)
    20. UnityEditorInternal.IL2CPPBuilder.Run () (at <79e7264827bd431fb11de781f3b150c2>:0)
    21. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <79e7264827bd431fb11de781f3b150c2>:0)
    22. PostProcessWinRT.RunIL2CPPForProjectBuild () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1903)
    23. PostProcessWinRT.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1872)
    24. PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:212)
    25. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:86)
    26. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    27. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:90)
    28. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <79e7264827bd431fb11de781f3b150c2>:0)
    29. 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)
    30. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    31.  
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
  3. adrian-lupsan

    adrian-lupsan

    Joined:
    Jul 4, 2016
    Posts:
    9
    I've just sent a bug report. Looking forward to the fix.
     
    LeonhardP and JoshPeterson like this.
  4. RendergonPolygons

    RendergonPolygons

    Joined:
    Oct 9, 2019
    Posts:
    98
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    I don't recall which bug report this is, so I can't give a status update, sorry!
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
  7. adrian-lupsan

    adrian-lupsan

    Joined:
    Jul 4, 2016
    Posts:
    9
    RendergonPolygons likes this.
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    Thanks for pointing that one out @Tautvydas-Zilys! Our team has corrected it, and a fix is on the way to Unity versions now.
     
    RendergonPolygons likes this.
  9. RendergonPolygons

    RendergonPolygons

    Joined:
    Oct 9, 2019
    Posts:
    98
    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 :)
     
    Last edited: Dec 17, 2021
    adrian-lupsan likes this.
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    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:

    Code (CSharp):
    1. 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.
     
    RendergonPolygons likes this.
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    The fix for the issue landed in 2021.2.8f1 and 2022.1.0b3.