Search Issue Tracker
Fixed in 2020.3.45f1
Fixed in 2020.3.X, 2021.3.X, 2022.2.X, 2023.1.X, 2023.2.X, 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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note (fix version 2023.2):
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):
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):
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):
Fix crash when building ScriptableObject asset in Resources folder, where source filename did not match the class name.
Resolution Note (fix version 2020.3):
Fix crash when building ScriptableObject asset in Resources folder, where source filename did not match the class name.