getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
199 stars 51 forks source link

IL2CPP builds fail with code stripping: High #249

Open bitsandfoxes opened 3 years ago

bitsandfoxes commented 3 years ago

Unity 2021.1.12

Exception: IL2CPP error for method 'System.Collections.Immutable.ImmutableDictionary2<TKey,TValue> System.Collections.Immutable.ImmutableDictionary::CreateRange(System.Collections.Generic.IEnumerable1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>>)' in assembly '/Users/bitfox/_Workspace/unity_2021_1_12/Temp/StagingArea/assets/bin/Data/Managed/System.Collections.Immutable.dll'

Unity 2020.3.12

Exception: IL2CPP error for method 'System.Byte Sentry.Internal.Extensions.StreamExtensions/d__0::System.Collections.Generic.IAsyncEnumerator.getCurrent()' in //src/Sentry/Internal/Extensions/StreamExtensions.cs:16707566

Unity 2019.4.21

Exception: IL2CPP error for type 'System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1' in assembly '/Users/bruno/git/sentry-unity/samples/unity-of-bugs/Temp/StagingArea/Data/Managed/Microsoft.Bcl.AsyncInterfaces.dll'

vaind commented 2 years ago

Doesn't look like a "Bug" to me. If anything, this is a unity issue? Is it actually actionable here? If not, I'd close this and/or report as a Unity bug

bitsandfoxes commented 2 years ago

At the time it wasn't quite clear who or what the culprit was. Unity provides the option of adding a link.xml to preserve code from the code stripper and I wasn't sure if there wasn't a way to actually fix it ourselves. We'll have to revisit this issue now with the addition of the Alias tool.

bruno-garcia commented 2 years ago

It's possibly something we can fix with link.xml but if not, perhaps we need to open an issue with Unity. As a dev, building for mobile, I'll want my app and smaller as possible, and sounds like code stripping mode high is a way to achieve that. This came up on Discord before too.