Search Unity

Endless string of Null reference Errors in Build only

Discussion in 'Windows' started by mat108, Mar 6, 2020.

  1. mat108

    mat108

    Joined:
    Aug 24, 2018
    Posts:
    131
    Build was acting weird, lots of bugs and things not working. I compiled a development build and checked the log file and indeed there were null reference exceptions (why didn't they appear in the editor?). The values for these supposedly missing references are clearly set in the inspector (serialized private fields).

    I began debugging but quickly realised there's something else going on. Even adding exception catcher lines like checking for null reference and reacquiring the missing reference before executing whatever code I need them for didn't work. The reference was still treated as missing in my build. Again, not in the editor.

    I began removing the problematic gameobjects and quickly realised the bogus missing reference exception just kept jumping from one object to another. It's obvious to me now that I'm missing something more fundamental, but I have no way of figuring out what that is given that everything works perfectly fine in the editor.

    Please help me, I'm starting to become very impatient and irritated and this.

    (Also why am I not allowed to add tags? That is incredibly dumb. What purpose do tags serve if posters can't add them?)
     
  2. mat108

    mat108

    Joined:
    Aug 24, 2018
    Posts:
    131
    Additionally, even after removing every active gameObject and leaving only a bare minimum of scripts (only my playerobject fps controller and a static cube for him to walk on) I run into issues.

    A development build starts out fine but after 6-8 seconds gives bogus 'null reference exceptions' when the references are clearly set, there is no dependencies and there were no alterations to any values.

    Am I demanding too much from Unity ? Can it not handle the outrageously straineous demands I'm putting on it (running 3 scripts with a minimum of dependencies) ?

    I'm completely baffled here.