link.xml for a monobehaviour?


I have basically a monobehaviour and I use reflection to access one of it’s getter, and it fails to work on IOS when stripping… so I would like a confirmation that this link.xml is properly formatted and the problem would then be elsewhere.

What is the correct link.xml content for a monobehaviour then?

The error I get is:

Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method 'System.Reflection.MonoProperty:GetterAdapterFrame<PlayMakerThirdPersonControllerProxy, int> (System.Reflection.MonoProperty/Getter`2<PlayMakerThirdPersonControllerProxy, int>,object)' while running with --aot-only.

  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.GetMemberValue (System.Reflection.MemberInfo member, System.Object target) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.GetMemberValue (System.Reflection.MemberInfo[] memberInfo, System.Object target) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmProperty.GetValue () [0x00000] in <filename unknown>:0 



link.xml allows you to tell the stripper that certain .NET features should not be removed. It’s not really related to reflection in any way, just use of reflection is something the stripper doesn’t know about. It should not be needed if you are just using regular MonoBehaviour things.

Also, bear in mind that reflection usually requires code to be generated and compiled at runtime. Runtime code-generation is not supported on iOS devices.