Search Issue Tracker
By Design
By Design in 2023.1.X
Votes
0
Found in
2020.3.40f1
2021.3.11f1
2022.1.17f1
2022.2.0b8
2023.1.0a12
Issue ID
UUM-18938
Regression
Yes
Script can't be instantiated in the Player when the project is built with IL2CPP
How to reproduce:
1. Open the user-attached project “2022.2 Beta Project”
2. Build And Run the project with IL2CPP Scripting Backend
3. Observe the Development Console in the Player
Expected result: There are no errors
Actual result: There is an error logged in the Console
Reproduced with: 2020.3.40f1, 2021.3.1f1, 2021.3.11f1, 2022.1.0b16, 2022.1.17f1, 2022.2.0a11, 2022.2.0b8, 2023.1.0a12
Not reproduced with: 2021.3.0f1, 2022.1.0b15, 2022.2.0a10
Reproduced on: Windows 11 Pro
Note: Not reproduced in Editor
Full error:
The script 'SerializationBug' could not be instantiated!
A scripted object (probably SerializationBug?) has a different serialization layout when loading. (Read 32 bytes but expected 68 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
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
- Crash on MarkAllDependencies when opening scenes with Assets from the YarnSpinner package
- Crash on CollectAllSceneManagerAndObjectIDs when opening a specific Scene
- GPU device suspended error when replaying a video in the Video Player with NVIDIA Vertical Sync set to Fast
- GPU device suspended error when replaying a video in the Video Player with NVIDIA Vertical Sync set to Fast
- SetComponentEnabled uses class instead of struct when constraining Enableable Component type
Resolution Note:
This issue is related to the specific project using a Unity API method in a static constructor, which is not allowed in this case.
Resolution Note (2023.1.X):
This issue is related to the specific project using a Unity API method in a static constructor, which is not allowed in this case.