iOS Crash 2020.4.11f PresentGLES

Hi,

I’m having a crash when launching Unity in my iOS app. I found some other issues around PresentGLES but most of those implied that newer versions of Unity fix the issue, however I’m on a very current version. I embedded Unity into my native app and I suspect there is some issue with the way things are initialized. It doesn’t crash reliably, however, so it’s really hard to test and debug. My stack trace is below. I’d really appreciate any help anybody may have. Unfortunately I can’t switch to metal because the new google cardboard plugin doesn’t support metal currently.

Main Thread:
com.apple.main-thread
0 libsystem_kernel.dylib 0x199d611d4 semaphore_wait_trap + 8
1 libdispatch.dylib 0x199bf9c90 _dispatch_sema4_wait$VARIANT$mp + 24
2 libdispatch.dylib 0x199bfa2e8 _dispatch_semaphore_wait_slow + 140
3 Flowly 0x105574028 Baselib_SystemSemaphore_Acquire + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4 Flowly 0x104ea78d4 GfxDeviceClient::AcquireThreadOwnership() + 3167 (GfxDeviceClient.cpp:3167)
5 Flowly 0x104ecf60c gles::CreateUpdateRenderSurface(ApiGLES*, RenderSurfaceGLES*, RenderSurfaceType, TextureDimension, TextureID, unsigned int, GraphicsFormat, SurfaceCreateFlags, RenderSurfaceDesc const&) + 263 (RenderSurfaceGLES.cpp:263)
6 Flowly 0x1054c5d44 UnityCreateExternalSurfaceGLES + 172 (CommonLibEntry.mm:172)
7 Flowly 0x10464cc0c CreateUnityRenderBuffersGLES + 196 (GlesHelper.mm:196)
8 Flowly 0x1046be3e0 -[DisplayConnection recreateSurface:] + 209 (DisplayManager.mm:209)
9 Flowly 0x1047437b4 -[UnityView recreateRenderingSurface] + 138 (UnityView.mm:138)
10 Flowly 0x104743618 -[UnityView recreateRenderingSurfaceIfNeeded] + 115 (UnityView.mm:115)
11 Flowly 0x1046ba5c0 -[UnityAppController(Rendering) repaint] + 86 (UnityAppController+Rendering.mm:86)
12 Flowly 0x104651b60 -[UnityAppController(ViewHandling) showGameUI] + 212 (UnityAppController+ViewHandling.mm:212)
13 Flowly 0x10465b4f4 -[UnityAppController startUnity:] + 139 (UnityAppController.mm:139)
14 Foundation 0x19a3725bc __NSFireDelayedPerform + 412
15 CoreFoundation 0x199f0c134 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 28
16 CoreFoundation 0x199f0be50 __CFRunLoopDoTimer + 880
17 CoreFoundation 0x199f0b52c __CFRunLoopDoTimers + 276
18 CoreFoundation 0x199f0653c __CFRunLoopRun + 1640
19 CoreFoundation 0x199f05ba8 CFRunLoopRunSpecific + 424
20 GraphicsServices 0x1a407c344 GSEventRunModal + 160
21 UIKitCore 0x19e0413e4 UIApplicationMain + 1932
22 Flowly 0x104744d1c main + 24 (AppDelegate.swift:24)
23 libdyld.dylib 0x199d8d8f0 start + 4

Unity GFX Worker Thread
Crashed: UnityGfxDeviceWorker
0 AppleMetalGLRenderer 0x1b4ae5b0c GLRResourceList::addFence(GLRResource*)
1 AppleMetalGLRenderer 0x1b4af5ab8 GLDContextRec::flushContextInternal()
2 AppleMetalGLRenderer 0x1b4af5ab8 GLDContextRec::flushContextInternal()
3 GLEngine 0x1b4ad7ff0 gliPresentViewES_Exec
4 OpenGLES 0x1b4b03af4 -[EAGLContext presentRenderbuffer:] + 72
5 Flowly 0x10464d1b4 PresentGLES + 372 (GlesHelper.mm:372)
6 Flowly 0x1046be5dc -[DisplayConnection present] + 251 (DisplayManager.mm:251)
7 Flowly 0x1046bf1d4 __25-[DisplayManager present]_block_invoke + 411 (DisplayManager.mm:411)
8 Flowly 0x1046bee44 -[DisplayManager enumerateDisplaysWithBlock:] + 380 (DisplayManager.mm:380)
9 Flowly 0x1046ba89c -[UnityAppController(Rendering) callbackPresent:] + 122 (UnityAppController+Rendering.mm:122)
10 Flowly 0x1046bac24 UnityPresentContextCallback + 162 (UnityAppController+Rendering.mm:162)
11 Flowly 0x10521b8a4 ContextGLES::Present() + 94 (ContextGLESApple.cpp:94)
12 Flowly 0x104ec6ecc GfxDeviceGLES::PresentFrame() + 1138 (GfxDeviceGLES.cpp:1138)
13 Flowly 0x104ebb994 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) + 1348 (GfxDeviceWorker.cpp:1348)
14 Flowly 0x104ebc5cc GfxDeviceWorker::RunExt(ThreadedStreamBuffer&) + 423 (GfxDeviceWorker.cpp:423)
15 Flowly 0x104eb2e54 GfxDeviceWorker::RunGfxDeviceWorker(void*) + 387 (GfxDeviceWorker.cpp:387)
16 Flowly 0x105154544 Thread::RunThreadWrapper(void*) + 78 (Thread.cpp:78)
17 libsystem_pthread.dylib 0x199ca3d98 _pthread_start + 156
18 libsystem_pthread.dylib 0x199ca774c thread_start + 8

Any Solution @juliens137