-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dynamic method emit prevents usage on some platforms (Unity IL2CPP + Android / IOS) #31
Comments
Thanks for letting me know, this needs some investigation and possibility I need to fall back to reflection on unsupported platforms |
Can you give me your device details please? And are you using MAUI or Xamarin? |
This affect all devices basically, since its a platform restriction. For the testing purposes I've used Unity + .Net 2.1. Reflection "reading" is fine, generating new code is not. |
I believe it is Unity problem then MAUI has support for Emits |
I think its more of an IL2CPP issue (no emit support), because it expects everything to be compiled AOT. https://forum.unity.com/threads/notsupportedexception-with-log-detail.543644/#post-8186325 |
Calling into reflection emit will cause a PlatformNotSupportedException. (which is called into upon initialization)
PlatformNotSupportedException: Operation is not supported on this platform. at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Reflection.Module m, System.Boolean skipVisibility) [0x00000] in <00000000000000000000000000000000>:0 at Salar.Bois.Types.BoisTypeCompiler.ComputeWriter (System.Type type, Salar.Bois.Types.BoisComplexTypeInfo typeInfo, System.Action1[T] beforeMehodBody, System.Reflection.Module containerModule) [0x00000] in <00000000000000000000000000000000>:0 at Salar.Bois.Types.BoisTypeCache.GetRootTypeComputed (System.Type type, System.Boolean generateReader, System.Boolean generateWriter) [0x00000] in <00000000000000000000000000000000>:0
Possible solution to this is to perform Ahead-Of-Time compilation of the methods & types required.
The text was updated successfully, but these errors were encountered: