Search Unity

Resolved Model makes app crashes on init. How I can debug it properly?

Discussion in 'VR' started by carcasanchez, Jan 12, 2021.

  1. carcasanchez

    carcasanchez

    Joined:
    Jul 15, 2018
    Posts:
    177
    Hello, friends!
    As title says, I'm having a crash when trying to load an app on Oculus Quest (1). I do not get to see the Unity logo popping up, it simply does not start and returns to Quest main menu.
    There's some specific FBX models (which where generated inside Unity via plugin and the exported to fbx) that may be causing the issue. If I delete them, app starts to work again.
    But there's two things that confuse me. One, the model is incredibly simple. Two, some builds will work fine 100%. There's times when I delete parts of the app to test things, but leaving the model, and the app crashes again. It's a very random behaviour.
    Moreover: the app crashes even without loading the scene with the model! Just by adding that scene on build settings, the app don't start. If I remove them, it works again.
    I am 90% sure the culprit is the model in question, but I still want to know why, because it's a very simple model (it's skinned, by the way), and the fact that only by adding it to build settings makes the app not start.

    However, I have the issue of not being able to debug anything in particular. Unity profiler doesn't get to connect to Quest, because the app doesn't get to start. Adb logcat shows rather intrascendent logs:
    upload_2021-1-12_10-4-30.png
    No errors, no warnings spotted. Just the app stopping working.

    Models are around 1MB heavy, which is nothing. I tried to open them in a FBX editor, and they are perfectly normal meshes, with low polycount and a simple skeleton.
    What other debug methods can I try to isolate the problem?
     
  2. carcasanchez

    carcasanchez

    Joined:
    Jul 15, 2018
    Posts:
    177
    Update: extended my experiments, and found that, of the three same-style models I use, only one is causing the issue. This confuses me even more, since all three models use the same materials, scripts, and have similar polycounts.
    Moreover: I do not have to put it into the scene to make the app crash. I have a game object spawner in scene, and just by adding a reference to the model, and then adding the scene to build settings, the game won't start, event the initial scene has no references to the said model.
    Which makes me wonder what can be causing the issue, and how I can debug it. Memory usage, at least in editor, seems the same for the issue model and other perfectly fine models.
     
  3. carcasanchez

    carcasanchez

    Joined:
    Jul 15, 2018
    Posts:
    177
    I have solved the issue! It still confuses me, but I have made it to work.
    It was a material. When saving the on-editor-generated mesh to fbx, with some models I exported the materials inside the fbx. With this last model, I assigned the on-editor one. They are exactly the same materials, but for whatever reason, Oculus Quest didn't liked it, even when only referencing it in Build Settings.
    Maybe someone could explain me what could be happening?