playMaker

Author Topic: iOS JIT issue, please HELP!  (Read 2892 times)

alexlange

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
iOS JIT issue, please HELP!
« on: January 31, 2014, 03:24:03 AM »
Using PlayMaker upgraded today and it fails on iOS device, keep throwing exception. It works literally good on Editor and simulation.

http://hutonggames.com/playmakerforum/index.php?topic=6026.0
This bro change his API-Level to .NET 2.0 Subset and avoid this problem.
But in my game, lots of scripts are strongly related to System.Data so can't change it to subset.

Any idea how to fix it? :'(

*Exception in XCode5
Code: [Select]
ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) System.Reflection.MonoProperty/Getter`2<UnityEngine.GameObject, UnityEngine.GameObject>:invoke_GameObject__this___GameObject (UnityEngine.GameObject)' while running with --aot-only.



  at System.Reflection.MonoProperty.GetterAdapterFrame[GameObject,GameObject] (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.OnEnter () [0x00000] in /Users/MyPathOnMAC/Assets/PlayMaker/Actions/GetProperty.cs:24

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

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

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

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

  at HutongGames.PlayMaker.Fsm.UpdateStateChanges () [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/MyPathOnMAC/Assets/PlayMaker/Actions/GetProperty.cs Line: 24)



ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) System.Reflection.MonoProperty/Getter`2<UnityEngine.GameObject, UnityEngine.GameObject>:invoke_GameObject__this___GameObject (UnityEngine.GameObject)' while running with --aot-only.



  at System.Reflection.MonoProperty.GetterAdapterFrame[GameObject,GameObject] (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/MyPathOnMAC/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/MyPathOnMAC/PlayMaker/Actions/GetProperty.cs Line: 34)
« Last Edit: January 31, 2014, 03:32:36 AM by alexlange »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: iOS JIT issue, please HELP!
« Reply #1 on: January 31, 2014, 05:13:35 AM »
Hi,

 you'll need to remove all the use of "Get property" custom actions to remove the need for reflections.

 I am afraid this is the only way.

What's your use of Get Property, I  may be able to write a custom action for you to solve that issue.

bye,

 Jean

alexlange

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: iOS JIT issue, please HELP!
« Reply #2 on: January 31, 2014, 07:06:20 AM »
Hi,

 you'll need to remove all the use of "Get property" custom actions to remove the need for reflections.

 I am afraid this is the only way.

What's your use of Get Property, I  may be able to write a custom action for you to solve that issue.

bye,

 Jean

Heads up: I solved this for now

Thank you! :)
I didn't use set property, but hundreds of get property in my game scene. Luckily in general, they do a same thing-- get a component from its own GameObject.

I put a script named Expose on each AI character to expose property such as ID, HP and some calculate result(like predict fighting advantage ) to PlayMaker. Those property can be set by both my script and FSM.SendMessage(). I find it in this way, Script and FSM can co-op with each other easily.

What I did is pretty simple, I drag Expose component from the editor inspector to PlayMaker Editor and there will be a GetProperty, then I store this component as object variable in PlayMaker. So I can use GetProperty to get whatever property I need in Expose and store it as variable.
All types I used in Expose: int, string, bool, float, vector3.
If you can help me, I will really appreciate this!  :)

BTW, after review PlayMaker files, I find that compile problem may relate to FsmProperty class' refs. But I don't exactly know what is missing in .NET subset compare with full .NET.
Is it possible to fix the compile problem in short time?

« Last Edit: February 01, 2014, 08:00:14 PM by alexlange »

alexlange

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: iOS JIT issue, please HELP!
« Reply #3 on: February 01, 2014, 07:58:51 PM »
After lots of codes changed, eventually I've turned api-level into the subset and avoid compile problem as promised, it throws another exception though.
Still wish developer will fix the full .NET compatibility of Get/SetProperty soon in future version, it's a big hidden trouble for people who need to use c# dlls or flexible assets.
« Last Edit: February 01, 2014, 08:00:54 PM by alexlange »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: iOS JIT issue, please HELP!
« Reply #4 on: February 03, 2014, 02:54:26 AM »
Hi,

 I never really understood that kind of compiler problems, but I think it's a problem of design, that at runtime using reflection is an issue, I don't think it's related to PlayMaker nor the way get/set property is designed, it's the c# reflection system in itself that is the issue.

 Correct me if I am wrong :)

bye,

 Jean

alexlange

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: iOS JIT issue, please HELP!
« Reply #5 on: February 03, 2014, 07:12:04 PM »
Hi,

 I never really understood that kind of compiler problems, but I think it's a problem of design, that at runtime using reflection is an issue, I don't think it's related to PlayMaker nor the way get/set property is designed, it's the c# reflection system in itself that is the issue.

 Correct me if I am wrong :)

bye,

 Jean

I think you're right.  :)
In the interest of time, I didn't make it further. But it should be easy to reproduce, switch a api-level to full .NET2 and use GetProperty once. I will report it as a bug.
« Last Edit: February 03, 2014, 07:13:42 PM by alexlange »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: iOS JIT issue, please HELP!
« Reply #6 on: February 04, 2014, 02:50:56 AM »
Hi,

 It's very well known actually. It's by design, and not a bug actually.

bye,

 Jean