Reply To: OnDelete method for Task / Conditions / Actions

NodeCanvas Forums General Discussion OnDelete method for Task / Conditions / Actions Reply To: OnDelete method for Task / Conditions / Actions

#9129

Hi 🙂

The issue was on iPhone5S with iOS 8.02

error:

Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method ‘(wrapper dynamic-method) System.Runtime.CompilerServices.ExecutionScope:lambda_method (System.Runtime.CompilerServices.ExecutionScope,object,object,object,object)’ while running with –aot-only.

at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0
at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0
at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType, System.Object target) [0x00000] in <filename unknown>:0
at System.Linq.Expressions.EmitContext.CreateDelegate (System.Runtime.CompilerServices.ExecutionScope scope) [0x00000] in <filename unknown>:0
at System.Linq.Expressions.CompilationContext.CreateDelegate (Int32 unit, System.Runtime.CompilerServices.ExecutionScope scope) [0x00000] in <filename unknown>:0
at System.Linq.Expressions.CompilationContext.CreateDelegate () [0x00000] in <filename unknown>:0
at System.Linq.Expressions.LambdaExpression.Compile () [0x00000] in <filename unknown>:0
at System.Linq.Expressions.Expression1[System.Action4[System.Object,System.Object,System.Object,System.Object]].Compile () [0x00000] in <filename unknown>:0
at NodeCanvas.NCReflection.BuildDelegate[Action

4] (System.Reflection.MethodInfo method, System.Object[] missingParamValues) [0x00000] in <filename unknown>:0
at NodeCanvas.Actions.ExecuteFunction.OnInit () [0x00000] in <filename unknown>:0
at NodeCanvas.Task.Initialize (UnityEngine.Component newAgent) [0x00000] in <filename unknown>:0
at NodeCanvas.Task.Set (UnityEngine.Component newAgent, NodeCanvas.Blackboard newBB) [0x00000] in <filename unknown>:0
at NodeCanvas.ActionTask.ExecuteAction (UnityEngine.Component agent, NodeCanvas.Blackboard blackboard, System.Action
1 callback) [0x00000] in <filename unknown>:0

(Filename: /Applications/buildAgent/work/d63dfc6385190b60/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 49)

(lldb)

As far as I know the “System.Reflection.Emit” api is available in mono but does not work on iOS.
You can use reflection on iOS but there is no way to compile code at runtime. And I think that “System.Reflection.Emit.DynamicMethod.CreateDelegate” does this. But I am not a .net Reflection Pro!

Cheers! 🙂