Search Issue Tracker
Won't Fix
Votes
0
Found in
2019.4
2020.3
2021.2
2021.2.8f1
2022.1
2022.2
Issue ID
1396246
Regression
No
Build fails when building for iOS using IL2CPP and Realm Unity SDK
Reproduction steps:
1. Download and open the attached "IL2CPP_Repro.zip" project
2. Build for iOS
3. Observe the console window
Expected result: The build succeeds
Actual result: The build fails with a "Stack overflow" error
Reproducible with: 2019.4.35f1, 2020.3.27f1, 2021.2.10f1, 2022.1.0b6, 2022.2.0a3
-
nirinchev
Feb 02, 2022 15:35
Hey, thanks for looking into this. I would like to challenge the assessment though. Adding an attribute to the constructor of that same attribute is something supported in c# and the compiler generates IL that is fully supported by ILSpy and JustDecompile, implying that the IL is valid. I've put up a simple .NET 6 project that reproduces this, but it is something that is supported at least since netstandard 2.0, possible even earlier: https://gist.github.com/nirinchev/b9c614e39bbfe957e7954b6d1093ed10.
Additionally, this appears to be a regression in the IL2CPP compiler - I tested this with Unity 2020.3.10f1 and the project compiles successfully with no code changes. I haven't tried to track down the exact Unity version that introduces the regression since I'm sure you're better equipped to figure it out. Since the UsedImplicitlyAttribute is added to Realm via the Remotion.Linq dependency, it will be fairly complicated to remove it on our end, so I hope to see this fixed on the Unity side.
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note:
This is the problem in the Realm.dll assembly in this project. It contains a type named JetBrains.Annotations.UsedImplicitlyAttribute, where the constructors of the attribute type use the attribute itself.