Search Issue Tracker

Won't Fix

Votes

0

Found in

2017.4.0f1

2018.3.0b9

Issue ID

1104214

Regression

No

[IL2CPP] The Obfuscator plugin causes Build to fail and prints unclear Stack Trace

IL2CPP

-

To reproduce:

1. Download attached project "ObfuscationRepro3 2.zip" and open in Unity
2. Press File > Build Settings...
3. Switch platform to Standalone, iOS or Android
4. Set Scripting Backend to IL2CPP
5. Press the Build button
6. Observe that Build fails
7. Inspect Console

Expected results: You will see a proper Stack Trace and you can backtrace what's going wrong
Actual results: You will see an unclear Stack Trace:

IL2CPP error for type 'PROJECTNAME.Exercise.ExerciseEvent' in PROJECTPATH/Assets/Libraries/MusicRepresentations/Exercise/ExerciseEvent.cs:82
Additional information: The given key was not present in the dictionary.
il2cpp.exe didn't catch exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Unity.IL2CPP.Metadata.VTableBuilder.OverrideInterfaceMethods(Dictionary`2 interfaceOffsets, List`1 slots, Dictionary`2 overrides, Dictionary`2 overrideMap)

Notes:
- If you change Scripting Backend to Mono everything will work fine
- Building with Obfuscation disabled works fine, so this is clearly an error there, but it'd be nice to get a better error message
- Could not check on Unity 2018.1 and 2018.3.0b12 because project becomes corrupted

Reproduced on Unity 2017.4.0f1, 2017.4.16f1, 2018.2.18f1, 2018.3.0b9 and 2019.1.0a10

  1. Resolution Note:

    IL2CPP is not a good IL verification tool. It assumes it gets valid IL as input. Instead, I'd recommend using peverify, which is an IL verification tool, to ensure that the obfuscated assembly is valid IL. In this case, the input IL to IL2CPP is not valid, hence the error.

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.