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

Bug Unity 2021.3.9 build error invalid propertyPath

Discussion in 'Editor & General Support' started by toan-stt, Sep 6, 2022.

  1. toan-stt

    toan-stt

    Joined:
    Sep 30, 2013
    Posts:
    11
    Hi,
    I updated unity to 2021.3.9 and tried to build IL2PCC win, but I got this error:

    Trying to update the managed reference registry with invalid propertyPath(likely caused by a missing reference instance)'managedReferences[2591244572266856457].cmp', with value ''


    Please help me to solve it
     
  2. rekatha

    rekatha

    Joined:
    Dec 18, 2017
    Posts:
    22
    Do we have fix for this issue ?
     
  3. abegue

    abegue

    Joined:
    Jan 28, 2019
    Posts:
    24
    The only workaround I found is to use a text editor to find the reference and delete it. In general, it also means that a reference has been lost so you may have to set the reference/value on this property again.

    I am not really sure of what it is the cause but I think this something like that:

    Say we have a prefab and an instance of it in the scene.
    In your prefab, you have a property that use [SerializeReference]. You setup an instance that have a property 'cmp' and set a value.
    Internally, it will create something like in your prefab asset (look at the reference id):
    Code (CSharp):
    1. - rid: 2591244572266856457
    2. [...]
    3. references:
    4.   version: 2
    5. RefIds:
    6.     - rid: 2591244572266856457
    7.       type: {yourClass}
    8.       data:
    9.          _cmp: {any value}
    Then, in the prefab instance in the scene, you override the value. In your scene asset, it will create something like (look at the reference id):
    Code (CSharp):
    1.     - target: {fileID: ..., guid: ..., type: 3}
    2.       propertyPath: managedReferences[2591244572266856457].cmp
    3.       value: {any new value}
    Now, you make some changes in the prefab and decide to get ride of the instance of your interface property. This change now replace 2591244572266856457 by, saying, 5166781093476565058.
    Your prefab is now okay but when you go back to your scene, the file still contains a "prefab override" whose the property path still reference the old id (2591244572266856457).
    Then, it will display you that:
    Trying to update the managed reference registry with invalid propertyPath(likely caused by a missing reference instance)'managedReferences[2591244572266856457].cmp', with value '{whatever}'


    It is just a hypothesis but perhaps it can help. Despite [SerializeReference] being really really really useful (it is so much powerful), I think I will stop using it while this bug is not fixed (I think it will need a big rework of how things work if my hypothesis is valid) since it corrupts your prefabs/scenes, introducing value/reference losses and prevent buildings.
     
    Celezt, Jamez0r, AldeRoberge and 4 others like this.
  4. LVermeulen

    LVermeulen

    Joined:
    Jun 26, 2013
    Posts:
    39
    Would be great to get some idea of where this is happening. The error message just gives the property name and doesn't say what prefab or even what script.
     
    juanborgesv, dtaddis and Flavelius like this.
  5. Dawid_Matuszewski

    Dawid_Matuszewski

    Joined:
    Mar 2, 2016
    Posts:
    22
    Same here. Do we have some fix of this error
    2021.3.28f1
     
    AR12D likes this.
  6. mgmhunt

    mgmhunt

    Joined:
    Apr 1, 2013
    Posts:
    61
    Encountered this on 2021.3.30f1 Mac.

    Trying to update the managed reference registry with invalid propertyPath(likely caused by a missing reference instance)'managedReferences[3449465115153006597].EventOriginTransform', with value ''

    Edit - luckily the corruption occurred in a script-generated scene, so I could overwrite it.
     
    Last edited: Oct 6, 2023
  7. JAMSCommercial

    JAMSCommercial

    Joined:
    Sep 1, 2023
    Posts:
    11
    Any Perfect Fix for this issue????!!!
     
  8. eelbee

    eelbee

    Joined:
    Jun 17, 2022
    Posts:
    2
    We keep running into this error also. Very annoying - especially that the fix is dependent on a text-editor, and cannot be handled via the Unity Editor itself.
     
  9. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    Indeed, this happens when renaming / moving classes when using [SerializeReference].
    I wish there was a better, in-editor way to fix this.
     
  10. coolfarmer

    coolfarmer

    Joined:
    Jun 14, 2018
    Posts:
    7
    This bug is SO FRUSTRATING, it should be fixed ASAP by Unity....
     
  11. jpfranssen_

    jpfranssen_

    Joined:
    Jul 20, 2018
    Posts:
    11
    Have my vote too, this is really inconvenient, takes a lot of time to track down and remove the stale references...
     
  12. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    205
    Also having this issue in Unity 2022.3.12f1, this is very frustrating, can someone from Unity PLEASE address this and how we can avoid it happening while you guys make a fix?
     
  13. LVermeulen

    LVermeulen

    Joined:
    Jun 26, 2013
    Posts:
    39
    Just a way to see where the issue is happening would be good. A better error message is all I am asking for :)
     
  14. jpfranssen_

    jpfranssen_

    Joined:
    Jul 20, 2018
    Posts:
    11
    I found to get rid of this message, is to click the x Unused overrides "button" shown when inspecting the object overrides.
    The error comes from the fact that when removing or changing scripts and/or script fields the previously serialized data in the scene remains (by design). For regular serialized fields [Serializefield] this is no problem (apart from the fact that it bloats the scene at some point). But it seems that for fields serialized with [SerializeReference] the path is checked for validity, which obviously is no longer valid due to removal or changes in the prefab.

    upload_2023-12-5_10-15-0.png
     
  15. Aionix

    Aionix

    Joined:
    Aug 31, 2018
    Posts:
    5
    Thank you so much!!
     
    jpfranssen_ likes this.
  16. Michoko

    Michoko

    Joined:
    Apr 15, 2017
    Posts:
    24
    You saved my life with this one, thank you so much!
     
    jpfranssen_ likes this.
  17. Alienoberle

    Alienoberle

    Joined:
    Apr 2, 2020
    Posts:
    1
    Another great option which worked for me I found on GitHub by Marc-Antoine Girard
    https://github.com/NovaUI-Unity/Feedback/discussions/276#discussioncomment-7029039

    Origin:
    This is indeed an error from Unity, which can appear when a prefab contains a SerializedReference variable (which ItemViews do) and overrides the value of something that doesn't require an override. It's pretty hard to reproduce since Unity usually tracks these things, but AFAIK, it should mostly happen when dealing with branches and Version Control.

    How to Fix:

    • Copy the GUID in the managedReferences[GUID here] error. Then, open your scene (the one that triggers the error) in a Text Editor.
    • CTRL+F (find) it in the file. Once you find it, it should look like this:


    - target: {fileID: 7062939149101832317, guid: [GUID here],
    type: 3}
    propertyPath: Label
    value: Something
    objectReference: {fileID: 0}


    • This is a Prefab override block. Select everything from -target to objectReference (basically the whole block) and delete that. Repeat the search and delete until there's no more block like that with that GUID.
    • Open Unity and Reload your scene. It should be fix now :)
     
    fleity and Jar_Coding like this.