Search Unity

UWP error in two machines

Discussion in 'Windows' started by ScottyDSB, Mar 29, 2021.

  1. ScottyDSB

    ScottyDSB

    Joined:
    Mar 18, 2016
    Posts:
    124
    Hello.

    I'm trying to compile a game that comes from PC standalone and there works well. I have cleaned all the stuff that could be related to problems, even just created a clean scene and deactivate the other scenes to generate a UWP. But a problem persists, the same in two machines, one with VS2019 updated and the other with VS2017 and VS2019 updated. It happens with Unity 2020.3.3. and 2021.1.1.

    Fact: if I create a new scene from scratch then it goes well.

    The output is this:

    Exception: IL2CPP error (no further information about what managed code was being converted is available)
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Unity.IL2CPP.Extensions.ModuleInitializerMethod(AssemblyDefinition assembly)
    at Unity.IL2CPP.Metadata.PerAssemblyCodeMetadataWriter.Write(SourceWritingContext context, AssemblyDefinition assembly, GenericContextCollection genericContextCollection, String assemblyMetadataRegistrationVarName, String codeRegistrationVarName)
    at Unity.IL2CPP.AssemblyConversion.SecondaryWrite.Steps.PerAssembly.WritePerAssemblyCodeMetadata.ProcessItem(GlobalWriteContext context, AssemblyDefinition item)
    at Unity.IL2CPP.AssemblyConversion.Steps.Base.ScheduledItemsStepFuncWithContinueAction`3.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)
    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String generatedCppOutputDirectory) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.Boolean platformSupportsManagedDebugging) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEditorInternal.IL2CPPBuilder.Run () (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    PostProcessWinRT.RunIL2CPPForProjectBuild () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1909)
    PostProcessWinRT.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1878)
    PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:211)
    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 <0c3742f371b24679bcaa6fcc508d0cca>: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 <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)


    I've been working on this for two days complete with no solutions and trying to find something in Google. Any help would be most appreciated. Thank you.
     
  2. ScottyDSB

    ScottyDSB

    Joined:
    Mar 18, 2016
    Posts:
    124
    Well after many tests I've found it was a problem related with an asset, asset upgraded and problem solved.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    mriindrahi and ScottyDSB like this.
  4. ScottyDSB

    ScottyDSB

    Joined:
    Mar 18, 2016
    Posts:
    124
  5. mriindrahi

    mriindrahi

    Joined:
    Apr 13, 2021
    Posts:
    4