Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug RTHandleSystem.Alloc java.lang.Exception - NullReferenceException on Android devices

Discussion in 'Universal Render Pipeline' started by an_n, Mar 21, 2024.

  1. an_n


    Apr 17, 2014
    Updated my Unity version from 2020 to 2022.3.22 and rewrote the code of my render pass / render feature and now I have this error showing up on some Android devices (at the moment only Android 6 & 7 but as I released recently other versions might be affected later as well, I just don't have enough crashlytics data).

    Code (csharp):
    1. Non-fatal Exception: java.lang.Exception: NullReferenceException : Object reference not set to an instance of an object.
    2.        at UnityEngine.Rendering.RTHandleSystem.Alloc(UnityEngine.Rendering.RTHandleSystem)
    3.        at UnityEngine.Rendering.RTHandles.Alloc(UnityEngine.Rendering.RTHandles)
    4.        at UnityEngine.Rendering.Universal.RenderingUtils.ReAllocateIfNeeded(UnityEngine.Rendering.Universal.RenderingUtils)
    5.        at UnityEngine.Rendering.Universal.Internal.RenderTargetBufferSystem.ReAllocate(UnityEngine.Rendering.Universal.Internal.RenderTargetBufferSystem)
    6.        at UnityEngine.Rendering.Universal.Internal.RenderTargetBufferSystem.GetBackBuffer(UnityEngine.Rendering.Universal.Internal.RenderTargetBufferSystem)
    7.        at UnityEngine.Rendering.Universal.UniversalRenderer.CreateCameraRenderTarget(UnityEngine.Rendering.Universal.UniversalRenderer)
    8.        at UnityEngine.Rendering.Universal.UniversalRenderer.Setup(UnityEngine.Rendering.Universal.UniversalRenderer)
    9.        at UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera(UnityEngine.Rendering.Universal.UniversalRenderPipeline)
    10.        at UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack(UnityEngine.Rendering.Universal.UniversalRenderPipeline)
    11.        at UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render(UnityEngine.Rendering.Universal.UniversalRenderPipeline)
    12.        at UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal(UnityEngine.Rendering.RenderPipelineManager)
    In the editor, on my Android 11 Samsung, on my Iphone & Ipad - everything works well without errors.
    I can provide my code for render feature/pass if needed but according to the stacktrace above it's not related but maybe I'm wrong.
    Please help!