-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible with IL2CPP #24
Comments
Hi, Could you please provide example code for reproducing the issue? Unity version and target platform would be also helpful. I tried to reproduce the issue with PC Windows IL2CPP build and I did not get that exception. I used example code from README.md and |
Trying to get some internet points for anyone else that finds this in the future since I also ran into this. This is how I fixed it, check out the class comments for how and why I think it fixes it. I'm too lazy to rewrite things up here, so just read the class comments 😂
For my use case above, I needed a method that too 2 params, a It looks like you're trying to call a function with the signature of:
Hope this helps lol |
I am no expert on C# compiler but as I understand it, methods are not being "stripped", they are not being created at all. Generic methods are being created by compiler - each type and combination of types it stumbles upon when it reads the code creates a separate method. Since here the methods are constructed in runtime, it does not create those combinations AOT. As of why some methods with smaller number of parameters do exist - I don't know. In my case, 0 input and 1 output params callbacks were created, callbacks with 1 input and 1 output were not. Maybe compiler does create some basic types? No idea. But this is the reason why even [UnityEngine.Scripting.Preserve] attribute or linker xml file won't work - the methods aren't stripped - they don't exist. |
Callstack:
The text was updated successfully, but these errors were encountered: