Search Issue Tracker

Fixed

Fixed in 2021.3.29f1, 2022.3.5f1, 2023.1.5f1, 2024.1.0a1

Votes

0

Found in

2020.3.48f1

2021.3.21f1

2022.3.2f1

2023.1

2023.2.0a21

Issue ID

UUM-30763

Regression

No

IL2CPP Build fails when inline-setter optimization is used

--

-

How to reproduce:
1. Open the user-attached “ilreprosend.zip” project
2. Open the Build Settings window (File → Build Settings…)
3. Build the Project

Expected result: The project is successfully built
Actual result: Build fails on “System.ArgumentNullException: Value cannot be null”

Reproducible with: 2021.3.21f1, 2022.2.12f1
Couldn’t test with: 2020.3.46f1 (Downgrading the Editor causes unfixable compilation errors related to reproduction), 2023.1.0b9, 2023.2.0a8 (Compilation errors regarding Newtonsoft.Json)

Reproducible on: macOS Ventura 13.1 (Intel), Windows 11

Notes:
- User found that the issue is in: “IL_000d: stfld class System.Globalization.CultureInfo [Newtonsoft.Json]Newtonsoft.Json.JsonWriter::_culture”
- User also noted: “The inlining is fine, but note that the CultureInfo reference here lacks a correct scope. It should be [mscorlib]”
- Workaround: “Applying a PreserveBody attribute to the function disables the inline setter optimization:
IL_000d: callvirt instance void [Newtonsoft.Json]Newtonsoft.Json.JsonWriter::set_Culture(class [mscorlib]System.Globalization.CultureInfo)”

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.