Game crashes at launch in the simulator caused by RequestCreateTexture

Hello,
I’ve a problem that doesn’t appear all the time, but most of the time. When I try my game in the simulator, I got the following errors

RequestCreateTexture
SetupRenderTextureFromXRRequest (id: 2 col: 0x103181b70 d: 0x1031c7210 sr: 0x0)
RenderTexture::Create (id: 2)
IVRDeviceCallback_CreateEyeTextureResources 0x103181b70
IVRDeviceCallback_CreateEyeTextureResources 0x1031c7210
Presenting a drawable without a device anchor. This drawable won't be presented.
RequestCreateTexture
SetupRenderTextureFromXRRequest (id: 3 col: 0x10327fe30 d: 0x1031f66b0 sr: 0x0)
RenderTexture::Create (id: 3)
IVRDeviceCallback_CreateEyeTextureResources 0x10327fe30
IVRDeviceCallback_CreateEyeTextureResources 0x1031f66b0
Presenting a drawable without a device anchor. This drawable won't be presented.

Followed by a break point

Job.worker 2 (20): EXC_BAD_ACCESS (code=1, address=0x156480000)

Any idea of what can produces this?

Hi there! Sorry to hear you’re having trouble.

I haven’t seen this behavior before. Can you provide a little more information about your project?

  • What version of the Editor and package(s) are you using?
  • Is this using the Universal Render Pipeline, built-in, HDRP?
  • Have you modified any graphics settings from their default values?
  • Are you rendering for HDR without the P3 color space added to the list of Color Gamuts in Player Settings?
  • Are there any issues surfaced through Project Validation? (Project Settings > XR Plug-in Management > Project Validation)

Can you please submit a bug using the bug reporter? (Help > Report a bug...) If your project is very large, it can be easier to create a new project and copy over your settings or specific scenes/assets that trigger the bug. Or, if you can’t replicate the issue outside of your project, I recommend manually creating a zip by first removing the Library folder (you may want to back it up if the project takes a long time to import) and just packing up Assets, ProjectSettings, and Packages. You can also upload this to an alternative secure file sharing service like Google Drive or Dropbox if the upload itself is taking too long. Just include the link in the bug report text or share it here in a direct message, and we can investigate the issue.

Thanks for reporting this issue, and good luck!

Ran into similar issue with Unity 2022.3.19 + URP.

I fixed mine by setting MaxTextureSize to 512 or under from “Asset Import Overrides” in the lower left corner of Build Settings.
image

More details can be found on this thread: https://forum.unity.com/threads/ios-exc_bad_access-crash.1241491/

Looks like it’s more of an Xcode simulator problem. Hope this also help yours!

@vegankrabbypatty thanks! I tried on the device and it doesn’t crashes, but renders a black screen (I’ve sounds and interactions)
@mtschoen I’ll try to submit the problem but I’m trying few things before. On the device it doesn’t crash but renders a black screen. I don’t use HDR but post processing and anti-aliasing. I tried to disable post processing but it renders a black screen. This is the RequestCreateTexture that causes the issue, in XCode it’s indicated “Drawable without a device anchor”.