Unity 6 causing crashes related to async scene loading

Hey, I am in need of some help for a nasty problem we are having in our Unity project.

This is an Android project for Oculus Quest 2+3

Previously we were on Unity version 2021.3.27 and all of our features were working as desired, however we wanted keep up to date and avoid being incompatible with newer plugins so we decided to try updating to Unity 6.

Under Unity 6 I am getting several Android crashes that I do not understand. We have a splash screen scene in which we play a video using AVPro and then load our “lobby” scene asynchronously in the background.

Using the Unity 6 build, the app crashes while trying to transition to the lobby once it has asynchronously loaded after the splash video. I have tested a bunch of things, and there is no clear indication of where the crash is coming from.

  • Removing the video entirely from the splash screen allows you to load the lobby scene, however only the first time you launch the app, after that it will crash immediately on startup.

  • Changing from async load to an instant load does not cause this problem and does not crash unless I do it during the video.

So the video can be removed entirely but async load still crashes. I can switch to instant load but that crashes if I run it while the video is still playing, so the reason for the crash is still in there somewhere. The crash always comes with a very unhelpful and cryptic SIGSEGV error:

What is happening??? I am using the latest version of Avpro that says it is compatible with Unity 6, but even so, why am I experiencing crashing that corrupt the app just for loading a scene asynchronously?

I’m having the same problem with load async. I don’t use AVPRO, just a background image, so it’s irrelevant. Did you find a solution? (Windows standalone).

I am having the same problem with Unity 6.0.45 and Quest 3. Sometimes the load async work, some times not. 50/50%.

Has there been any fix for this? I read through the Meta replies and tested the theory that it will work in build and not in the Unity Editor, however that’s just not the case.
We have a few projects that have been migrated to Version 6 (6000.0.4f1) and all projects have the same async issue with Oculus, and simply crash when the game tries to Authenticate.
Meta also suggested to place the App ID directly into the script, such as Oculus.Platform.Core.AsyncInitialize(“appID”); but that also failed.
Any help would be really apprecaited!

You should symbolicate that stack trace to see what’s going on. Don’t guess, just symbolicate it.

We use async scene loading on quest 3, both from Addressables as well as a couple that are included in the build, without any problems on Unity 6.0 and 6.1, so it’s not as if Unity 6 async scene loading on quest is just broken or something.

I’ll refer you to the old classic: https://support.unity.com/hc/en-us/articles/115000292166-Symbolicate-Android-crash

Nice. Thanks Clay.. you’ve got me on the right track (there’s hope!) haha was about to go crazy!!.. just quickly, is the solution as simple as dropping the files in symbols.zip into the project?

Any chance you could share how you have Unity 6 and Oculus Core.Initialize working? Can’t find any real support online nor from Meta at this stage. Any insight would be extremely helpful..

Just follow the instructions at Stacktrace Utility | Android Logcat | 1.2.3 or https://support.unity.com/hc/en-us/articles/115000292166-Symbolicate-Android-crash.

It’s extremely straightforward.

try
{
    // We use methods instead of closures to avoid even more heap allocation...
    Core.AsyncInitialize(AppId).OnComplete(HandleInitComplete);
}
catch (Exception ex)
{
    // This is our game-specific stuff...
    Debug.LogError($"OPLAT: Error trying to initialize Oculus Core: {ex}");
    RaiseFatalError(RuntimeLocalizer.Instance.Get("NoOculusServices"));
}

private void HandleInitComplete(Message<PlatformInitialize> message)
{
    if (message.IsError)
    {
        Debug.LogError($"OPLAT: Failed to initialize Oculus core [{message.GetError()?.Message}]");
        RaiseFatalError($"{RuntimeLocalizer.Instance.Get("CannotStartOculusServices")}\n{message.GetError()?.Message}");
        return;
    }
    // And the chain of async callback things continues...
    Entitlements.IsUserEntitledToApplication().OnComplete(HandleEntitlement);
}

This style of async callbacks in lieu of async/await or coroutines is annoying, but works reliably with Meta’s SDK.

1 Like