- Home /
What would cause an app crash during LoadScene?
I have an app targeting Oculus Go, and a strange issue has come up. Namely, when I take a specific path through the app, at a certain point I do a LoadScene and this causes the app to exit and the Oculus Home to come up. What makes this so infuriating to debug is that I cannot get any useful information about what might be causing it.
The same scene can be loaded through a different path, and it works fine.
Rolling back to an earlier revision, it works fine. I narrowed it down to a commit that has no code changes to the scenes in question, after which it breaks. The only close-to-relevant change is an autogenerated change to the plugins csproj, adding a "subtype component" declaration, whatever that means.
Some of the first revisions with the bug exhibit the curious behavior of crashing the first time, but on subsequent load of the app, they work fine. Nondeterministic error? Awesome.
The big one - there are NO LOGS AT ALL in logcat that seem even somewhat related. I put logs on both sides of the scene load (in SceneLoaded and SceneUnloaded events, and on Awake in scripts in the new scene), and on one side i get the output "calling LoadScene" and that's the last line of unity output. Looking at all the logcat logs, I see a bunch of creepy facebook/oculus logs but they appear to simply be reporting on the fact that an app crashed and Oculus Home is reloading. Nothing else besides normal system heartbeat stuff.
So, how do you even begin to debug this? Let's say it was an out-of-memory issue: would this at least log something? Is there a way I can leverage LoadSceneAsync and get more information? (I tried this, and it still crashed. I don't know what other information I could glean from the async load but I don't usually use async loading)
Any advice, suggestions, or if anyone has had similar issues on Oculus Go, or android in general, with LoadScene causing a fully unreported crash condition? Thanks for any help.
After much investigation, I'm still unable to begin making progress. The scene transition in question sometimes works in a build, and other times does not, depending solely on the inclusion or exclusion of scenes which are never even loaded before the crash. I am beginning to suspect a bug in either the compilation or serialization engines, but I have yet to get the project to a manageable-sized repro. Why is there no way to debug this? Why does a full engine crash not make any kind of logcat statement? Ugh.
Answer by evan_spiegel · Oct 13, 2020 at 08:33 PM
Hey there, did you ever find a solution for this? I'm seeing a similar bug where my app randomly crashes sometimes when running LoadSceneAsync - I'm using Unity version 2019.3.15 and Oculus Quest. Thanks!
Your answer
Follow this Question
Related Questions
It's impossible to async load a scene then have it wait while unloading another? 2 Answers
Does Active/Inactive and Enabled/Disabled save memory? 1 Answer
Android Loading scene / loading assets problem 1 Answer
how do u load a scene when pressing e on a object in game? 3 Answers
Why is this rendering weirdly 1 Answer