- Home /
Did logic for selecting assemblies for UnusedByteCodeStripper2 and il2cpp change?
Project that went from 5.0.1f1 to 5.1.0p1.
Looking at the unity log during build, it appears that most of the managed dlls are NOT being included now in the UnusedByteCodeStripper2 and il2cpp command line calls. The only ones that ARE include Assembly-CSharp-firstpass.dll and Assembly-CSharp.dll. The rest of my plugin DLLs (confirmed they are in the Temp/StagingArea/Data/Managed/ directory) are NOT being picked up.
Did something change? Is there any logic that would cause them NOT to be picked up?
As far as what it is causing - I'm not sure...running into the old "Method not found: 'Default constructor not found ... ctor () of... " issue and trying to narrow down the possibilities.
Any help would be appreciated.
I don't believe that any of the logic about how assemblies are selected to pass to these tools occurred between 5.0.1f1 and 5.1.0p1, at least not on purpose. Note that even if the plugin DLLs are not on the command line, they should still be converted, as both of these tools convert all dependent assemblies. It might be worth submitting a bug report with this project, if possible.
Answer by casperjeff · Jun 24, 2015 at 10:10 PM
So delving down deep into this, some aspect of the 'default' stripping that il2cpp linker uses (regardless if you have stripping level set to 'none) has changed between 5.0.1f1 and 5.1.X. Now, a DLL assembly that we include in our project has seemingly 'unused' types (or even just fields and methods) stripped - causing later use to fail miserably when using reflection and/or CreateInstance. Yikes. Had to fall back on Link.xml file and list all our assembly packages (never could get wildcards to work in that thing!). That was many hours I will never get back. Why does it strip if I tell it not to strip?
In order to keep build sizes reasonable, the IL2CPP scripting backend always does the equivalent of byte code stripping, even when the "Stripping Level" setting in the editor is "Disabled". We are considering a real option to build without stripping, but we've not added it yet.
If you can submit a bug report with this project, I am interested to have a look at it, so that we can understand how the difference between 5.0.1f1 and 5.1 impacts stripping in this case.
Your answer
Follow this Question
Related Questions
MissingMethodException: Default constructor not found for type iOSStepCounter 0 Answers
No Line numbers in stack trace for debug android build using IL2CPP 1 Answer
Asset Bundle code stripping / link.xml not working 1 Answer
Issue with IL2CPP where Default Constructor is possibly stripped from assembly 1 Answer
Object.Instantiate produces error after I strip my iOS project 2 Answers