Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Unity 2019.4.23f1 Broke Prefabs and Project - NullReferenceException, ArgumentNullException

Discussion in 'Editor & General Support' started by studentvz, Apr 7, 2021.

  1. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Our sample project that works perfectly fine on all Unity versions from Unity 2017.4.32f1 to Unity 2019.4.21f is completely broken when opened with Unity 2019.4.23f1.

    We get NullReferenceExceptions, ArgumentNullExceptions, etc.

    We can run a scene and make a build, but the game is completely broken.

    Bug reported: 1327540
    *You can pull the same working project from a bug report that was reported on Unity 2019.4.18f1
     
    Last edited: Apr 7, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,522
    I'm sorry you've had this issue. Please consider using source control in order to guard and protect your hard-earned work.

    Personally I use git because it is free and there are tons of tutorials out there to help you set it up.

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up the right .gitignore file:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Now odds are it's only something trivially out of place, but GET YOUR PROJECT BACKED UP NOW FIRST!

    Finally, to investigate errors above, after you have backed up your project:

    Some notes on how to fix a NullReferenceException error in Unity3D
    - also known as: Unassigned Reference Exception
    - also known as: Missing Reference Exception
    - also known as: Object reference not set to an instance of an object

    http://plbm.com/?p=221

    The basic steps outlined above are:
    - Identify what is null
    - Identify why it is null
    - Fix that.

    Expect to see this error a LOT. It's easily the most common thing to do when working. Learn how to fix it rapidly. It's easy. See the above link for more tips.

    This is the kind of mindset and thinking process you need to bring to this problem:

    https://forum.unity.com/threads/why-do-my-music-ignore-the-sliders.993849/#post-6453695

    Step by step, break it down, find the problem.

    When you have identified more where the problem is, here is how to get help in the forums:

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    How to understand compiler and other errors and even fix them yourself:

    https://forum.unity.com/threads/ass...3-syntax-error-expected.1039702/#post-6730855

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/
     
  3. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Thank you for this detailed info. We have backups and we also use git. This is a sample project which we use to test the new Unity versions and report bugs.

    Some references in our prefabs in the inspector are missing, like wheel colliders, wheel models, audio sources, and other stuff that were assigned and worked without any issue in Unity 2019.4.21. Prefabs are all messed up, we have many prefabs, many scenes, this is a nightmare.

    There is for sure some bug with prefabs and it is possibly connected with "fix" in Unity 2019.4.23f1:
    Asset Pipeline: Fixed an issue with Prefabs reimporting every time a code change is made. (1294785)

    We tried to rebuild our scene but there are many "hidden" issues, like ArgumentNullException: Value cannot be null. Parameter name: Source. The object that is pointed by this error is completely the same as in Unity 2019.4.21 with all references, and when we double-click this error we get:
    The path /Users/bokken/buildslave/unity/build/Modules/Audio/Public/ScriptBindings/Audio.bindings.cs' does not seem to exist anymore on disk.
     
  4. MrCool92

    MrCool92

    Joined:
    Jul 13, 2015
    Posts:
    26
    Same thing happened to us when going from 2019.4.22f to 2019.4.23f. Make sure to reimport all prefabs once or twice.
     
    studentvz likes this.
  5. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Thank you. Reimport fixed it.
    Unity 2019.4.23 reimported all while opening project and we didn't think that this could fix it.
     
  6. massiveminiteam

    massiveminiteam

    Joined:
    Aug 28, 2018
    Posts:
    109
    We had the same issue with two projects. So much for LTS version I guess.