Search Issue Tracker

Fixed in 2019.4.X

Votes

21

Found in

2017.1.0f3

2017.3

2018.4

Issue ID

952786

Regression

Yes

Recursive Serialization is not supported error when calling Resources.LoadAll from static method

Serialization

-

To reproduce:

1. Download and open the attached "Dwarf Mountain New.zip" project.
2. Enter Play mode.
3. Notice the console.

Expected result: No "Recursive Serialization is not supported" errors are thrown.
Actual result: Few "Recursive Serialization is not supported" errors are thrown and Play mode gets paused.

Reproduced with: 2017.3.0b3, 2017.2.0f3, 2017.1.1p4, 5.6.3p4, 5.6.0f2
Not reproduced with: 5.6.0f1, 5.5.4p5, 2019.4.33f1, 2020.3.24f1, 2021.2.5f1, 2022.1.0a16
Regression introduced in: 5.6.0f2

Notes: Serialization errors appear only after the first time the game is launched. It might also appear every time game mode is entered, but if it does not, hen Unity needs to be restarted to reproduce the issue again. If in MainBase.cs script 23 lines with "singleton.InitializeProgram()" is removed, the issue does not appear since it stops all the consequent Resources.LoadAll() calls.

Error: "Recursive Serialization is not supported. You can't dereference a PPtr while loading. (Constructors of C# classes may not load objects either. See stack trace.)
UnityEngine.Resources:Load(String, Type)"

  1. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.33f1 and above

Comments (2)

  1. Krellumdaed

    Feb 22, 2020 18:06

    For me, this bug is more about how the issue is reported. In Unity 2019.2 I can build for all the platforms I care about: WebGl, iOS, Android, Fire, and Facebook. The code runs great with each build in the editor. When I build to put the code on a device the error shows up!!! If it works in the editor it should work on the device! The device can't handle it the editor should not handle it. Sure I understand a few expectations like Apple IAP not working in the editor makes sense but this basic of design approach is a critical flaw in the development environment!!!

  2. Legendary-Game-Studio

    Apr 30, 2018 17:32

    Please fix it, i cant make a scriptable singleton to work because this !

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.