Search Issue Tracker

By Design

Unknown (hidden) 2020.3.X, 2021.3.X, 2022.1.X, 2022.2.X, 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?

  1. 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.

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.