Hello everyone,
I have the following issue: When I try to build, open a specific scene or (sometimes) switching between the Scene tab and the Game tab I’m receiving the following error:
MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Material.set_shaderKeywords (System.String[] value) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Shaders/Material.bindings.cs:189)
UnityEngine.Rendering.Universal.Internal.PostProcessPass.Render (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/Passes/PostProcessPass.cs:500)
UnityEngine.Rendering.Universal.Internal.PostProcessPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/Passes/PostProcessPass.cs:269)
UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteRenderPass (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.ScriptableRenderPass renderPass, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/ScriptableRenderer.cs:1004)
UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteBlock (System.Int32 blockIndex, UnityEngine.Rendering.Universal.ScriptableRenderer+RenderBlocks& renderBlocks, UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData, System.Boolean submit) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/ScriptableRenderer.cs:963)
UnityEngine.Rendering.Universal.ScriptableRenderer.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/ScriptableRenderer.cs:759)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.CameraData cameraData, System.Boolean anyPostProcessingEnabled) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/UniversalRenderPipeline.cs:415)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/UniversalRenderPipeline.cs:572)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/Runtime/UniversalRenderPipeline.cs:265)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipeline.cs:51)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, System.Collections.Generic.List`1[T] renderRequests, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:115)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
This issue is blocking me to create a stable and usable build.
I tried to check if I some permission are missing for writing files within the PackageCache, but this is not the issue.
How should I debug this? Is a unity bug?