Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Recursive Serialization is not supported error in editor when launching

Discussion in '2019.3 Beta' started by Pimpace, Oct 9, 2019.

  1. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    38
    Snippet from my editor log:
    Code (text):
    1. ...
    2. [Package Manager] Done registering packages in 0.00s seconds
    3. Recursive Serialization is not supported. You can't dereference a PPtr while loading. (Constructors of C# classes may not load objects either. See stacktrace.)
    4. (Filename: C:\buildslave\unity\build\Runtime/Serialize/PersistentManager.cpp Line: 1386)
    5.  
    6. Refreshing native plugins compatible for Editor in 1848.38 ms, found 0 plugins.
    7. Preloading 0 native plugins for Editor in 0.00 ms.
    8. IsTimeToCheckForNewEditor: Update time 1570563370 current 1570595333
    9. Initialize engine version: 2019.3.0b6 (0612c96692fb)
    10. ...
    As you can see I got this weird Recursive Serialization is not supported. You can't dereference a PPtr while loading. (Constructors of C# classes may not load objects either. See stacktrace.) error message in editor, ONLY at first launch. I could find info about this error type but not in this "short" form. Also there is no stacktrace, or more useful info about what causes this error.
    In editor log, this is the only place where the error shows up.



    How can I gather more info/stacktrace or anything which helps determine what causes this error.
    I suppose it's there somewhere in my C# files, but I don't get any clue where it could be.
    Help!

    Thanks for advice!

    Pex
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,114
    Are you using a ScriptedImporter? It could be that you're referencing another asset in a serialized field in your importer. In that case you should use LazyLoadReference<> instead of a direct reference to the asset.
    https://docs.unity3d.com/2019.3/Documentation/ScriptReference/LazyLoadReference_1.html

    If that's not it could you please submit a bug report for this issue with a reproduction project? There is no way of telling what causes the "Recursive Serialization is not supported" error without access to the project.
     
    Last edited: Oct 9, 2019
  3. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    38
    Thanks @LeonhardP! I don't use ScriptedImporter. It started show this error after I added some prefab for UGUI elements. Also I have several ScriptableObject which interacts with editor inspector. But as I said, it shows up only the last couple of days. (I don't remember exactly, maybe after I updated to b6??)
    The weird thing is that it's only shows at first launch of editor beta6. After that i never get this message. Also there is no message in standalone build, even at start of the .exe

    Also this is very tough that Unity cannot show nay detailed error message or stacktrace. Why is that? I never see such a behavior before.

    Our project is quite big, and as it will be a game for sell, I don't know "sharing" our stuff is a good idea, even with Unity dev team, however I can attach all the editor logs and reports, dumps. That's why I asked here. Is there a command parameter for Unity or switch or anything i can get more detailed error report?

    Maybe this error is because of package manager? It suspicious that it shows up in quite top of editor log, scene even doesn't load.

    Can you help me?
     
  4. Pimpace

    Pimpace

    Joined:
    Sep 21, 2017
    Posts:
    38
    Okey... this is nuts and stupid.



    If you put ANY type of UI component into Preset Manager, Unity will throw this Recursive Serialization exception.

    You should pay me a reward fee for reveal this bug! :)

    Please tell your developer colleagues to take care of this. Have a nice day!

    ps.: also note, that user doesn't get any useful information/exception info/stacktrace or whatever about this type of error, please consider to improve your error handling/showing methods!
     
    Bunderant likes this.
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,114
    Thanks for the additional info. I've forwarded it to QA.
     
  6. Blinkq

    Blinkq

    Joined:
    Apr 19, 2015
    Posts:
    19
    yeap, same with me. Removing item from Preset Manager, fixed error. Thank you @Pimpace
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,114
    Pimpace likes this.
  8. arindamnsit

    arindamnsit

    Joined:
    Nov 15, 2019
    Posts:
    5
    Hi Leonard
    I am seeing the same trouble in Unity 2020.1.0b4 Beta version.
    Attached screenshot.

    Capture.PNG
     
  9. arindamnsit

    arindamnsit

    Joined:
    Nov 15, 2019
    Posts:
    5
    Issue is definitely not fixed yet.
    I am seeing the same trouble in Unity 2020.1.0b4 Beta version.
    Attached screenshot.
     
  10. tunisod

    tunisod

    Joined:
    Apr 14, 2020
    Posts:
    1
    The issue is still with the preset manager. This time go to where you project files are located and go to the ProjectSettings folder. Delete the PresetManager.asset file. Once you restart Unity the PresetManger.asset file will be recreated and the error should be gone for now. I'm not promising the error won't come back.
    I hope this helps.
     
    Neillium and bugfinda like this.
  11. kingsleyfs

    kingsleyfs

    Joined:
    Jul 5, 2012
    Posts:
    9
    thanks tunisod, works so far.
     
unityunity