Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: alexlange on February 03, 2014, 09:38:38 PM

Title: Get/SetProperty meet compile problem on iOS
Post by: alexlange on February 03, 2014, 09:38:38 PM
Exception:
Code: [Select]
ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) System.Reflection.MonoProperty/Getter`2<UnityEngine.Object, string>:invoke_string__this___Object (UnityEngine.Object)' while running with --aot-only.



  at System.Reflection.MonoProperty.GetterAdapterFrame[Object,String] (System.Reflection.Getter`2 getter, System.Object obj) [0x00000] in <filename unknown>:0

  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

  at HutongGames.PlayMaker.Actions.GetProperty.OnUpdate () [0x00000] in /Users/alex/Unity/Test/Assets/PlayMaker/Actions/GetProperty.cs:34

  at HutongGames.PlayMaker.FsmState.OnUpdate () [0x00000] in <filename unknown>:0

  at HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) [0x00000] in <filename unknown>:0

  at HutongGames.PlayMaker.Fsm.Update () [0x00000] in <filename unknown>:0

  at PlayMakerFSM.Update () [0x00000] in <filename unknown>:0

 

(Filename: /Users/alex/Unity/Test/Assets/PlayMaker/Actions/GetProperty.cs Line: 34)


Reproduce:
1. Add a FSM to any GameObject, attach a GetProperty action to it.
2. In build settings, use iOS platform and check script debugging.
3. Switch API-Compatibility-Level to .NET 2.0 (not subset) and SDK version to DeviceSDK in Player Settings.
4. Now, build & run, we can see compile exceptions of GetProperty keep throwing in XCode. In real game, this exception will stop playMaker from whatever it should do.

Discussion:
http://hutonggames.com/playmakerforum/index.php?topic=6209.0
http://hutonggames.com/playmakerforum/index.php?topic=6026.0

Solution:
It seems the only way out is use .NET2 subset instead for now. But others assets may have to use full .NET2, then conflict comes.
Title: Re: Get/SetProperty meet compile problem on iOS
Post by: Alex Chouls on February 05, 2014, 12:59:56 AM
I need to ping Unity about this. Will post an update when I have some leads...
Title: Re: Get/SetProperty meet compile problem on iOS
Post by: jeanfabre on February 05, 2014, 01:43:32 AM
Hi,

 I found this the other day on the topic.

http://www.reentrygames.com/unity-3d-using-extension-methods-to-solve-problems-with-generics-and-aot-on-ios/

This could be a direction to investigate.

bye,

 Jean
Title: Re: Get/SetProperty meet compile problem on iOS
Post by: vivalavida on August 17, 2015, 07:44:04 AM
Hi,

 I found this the other day on the topic.

http://www.reentrygames.com/unity-3d-using-extension-methods-to-solve-problems-with-generics-and-aot-on-ios/

This could be a direction to investigate.

bye,

 Jean


Hi, really sorry for posting on such an old thread, but is there any progress with this?
I have used the Get/Set Property actions way too many times to manually change each usage.
or any other alternative?
Title: Re: Get/SetProperty meet compile problem on iOS
Post by: jeanfabre on August 17, 2015, 02:32:45 PM
Hi,

 yes, totally, Basically you need to inform Unity about the classes you use when using Set/Get Property actions, because they use Reflections, Unity doesn't keep track of them, so you have to do this manually (http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html).

 But, I created a wizard to help you in that process:

http://hutonggames.com/playmakerforum/index.php?topic=9443.msg50405#msg50405

So with this wizard, you follow the instructions, run your game so that information is gathered, and then it creates the link.xml file automatically for you.

This wizard will go soon on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181), just haven't had time yet.

 Bye,

 Jean
Title: Re: Get/SetProperty meet compile problem on iOS
Post by: jeanfabre on September 10, 2015, 12:27:36 PM
Hi,

 it's now up and I made a video (https://youtu.be/cnCq-OPuLRE) for it as well.

 Bye,

 Jean