Search Issue Tracker
Fixed
Fixed in 2020.3.45f1, 2021.3.19f1, 2022.2.6f1, 2023.1.0b3, 2023.2.0a1
Votes
0
Found in
2020.3.43f1
2021.3.13f1
2022.2.1f1
2023.1.0a25
2023.2.0a1
Issue ID
UUM-21886
Regression
No
[All Ports Landed] Unity Editor crashes on CollectAllSerializeReferenceTypesAndPersistentCallTargets when building a project for Standalone Player [ScriptableObject class/source file mismatch]
Reproduction steps:
1. Open the attached project “Unity Extensions”
2. Build the project
Expected result: Build is successful
Actual result: Unity Editor crashes
Reproducible with: 2021.3.13f1
Couldn't test with: 2020.3.41f1, 2022.1.22f1, 2022.2.0b15, 2023.1.0a18 (Compiler errors: “EditorUserBuildSettings.il2CppCodeGeneration' is obsolete”)
Reproducible on: macOS Catalina 10.15.7 (Intel), Windows 10 (by user)
First few lines of stack trace:
0x00007ff63ca8896a (Unity) CollectAllSerializeReferenceTypesAndPersistentCallTargets
0x00007ff63ca8accd (Unity) CompileGameResourcesFolderDependencies
0x00007ff63d7a284b (Unity) BuildPlayerData
0x00007ff63d7ad007 (Unity) DoBuildPlayer_Build
0x00007ff63d7ab8e6 (Unity) DoBuildPlayer
Summary based on investigation:
The crash is related to two ScriptableObjects where the source file name does not match the class name. The Assets for these ScriptableObjects are stored in a Resources folder so they are included in the build.
When the source file is renamed to match the class name the crash does not occur. Unity shows a warning about the broken state of these objects when the project is opened.
!screenshot-1.png!
The project may not upgrade smoothly to later versions of Unity, but this bug almost certainly exists in later versions as well. It was also reported with a 2022 project (IN-27866)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Property (urp_ReflProbes_BoxMin) exceeds previous array size" warning spams console after switching platforms
- Have to change Input Mapping Path twice for change to take effect when Auto-Save is enabled
- No Duplicate option is available when right clicking States in the Animator Window even though it's available via Shortcut
- Copied and Pasted States appear in a set location instead of where the Users cursor is located at when using the Pasting Shortcut
- Animator Component information box text is not centered
Resolution Note (fix version 2023.2.0a1):
Improve error message, and remove possibility of crash, when a MonoBehaviour or ScriptableObject is being built that does not have a MonoScript.
Resolution Note (fix version 2023.1.0b3):
Improve error message, and remove possibility of crash, when a MonoBehaviour or ScriptableObject is being built that does not have a MonoScript.
Resolution Note (fix version 2022.2.6f1):
Improve error message, and remove possibility of crash, when a MonoBehaviour or ScriptableObject is being built that does not have a MonoScript.
Resolution Note (fix version 2021.3.19f1):
Fix crash when building ScriptableObject asset in Resources folder, where source filename did not match the class name.
Resolution Note (fix version 2020.3.45f1):
Fix crash when building ScriptableObject asset in Resources folder, where source filename did not match the class name.