NodeCanvas seems to be failing on start on iOS device. It works on other platforms, and works from Editor, only deployed build ran from XCode fails. The first call to Node.Error is “Infinite Loop. Please check for other errors…”
XCode screenshot attached.
In the log I see that it complains about an enum:
ExecutionEngineException: Attempting to call method ‘NodeCanvas.Framework.Variable1[[NPC_Valkyrie+ValkyrieStates, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null]]::.ctor’ for which no ahead of time (AOT) code was generated.
at NodeCanvas.Framework.Blackboard.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Blackboard.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0
Rethrow as InvalidOperationException: Constructor of NodeCanvas.Framework.Variable1[NPC_Valkyrie+Val at NodeCanvas.Framework.Blackboard.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0
NodeCanvas.Framework.Blackboard:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()
ExecutionEngineException: Attempting to call method ‘NodeCanvas.Framework.Variable1[[NPC_Two_Dialog_Behaviours+State, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null]]::.ctor’ for which no ahead of time (AOT) code was generated.
at NodeCanvas.Framework.Blackboard.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Blackboard.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0
Rethrow as InvalidOperationException: Constructor of NodeCanvas.Framework.Variable1[NPC_Two_Dial at NodeCanvas.Framework.Blackboard.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknNodeCanvas.Framework.Blackboard:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()
at NodeCanvas.BehaviourTrees.Switch.OnExecute (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Node.Execute (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Connection.Execute (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0
at NodeCanvas.Behavio at NodeCanvas.Framework.Node.Execute (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0
at NodeCanvas.BehaviourTrees.BehaviourTree.OnGraphUpdate () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.G at NodeCanvas.Framework.Graph.StartGraph (UnityEngine.Component agent, IBlackboard blackboard, Boolean autoUpdate, System.Action`1 callback) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.GraphOwner.StartBehaviour () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.GraphOwner.Start () [0x00000] in <filename unknown>:0
The enum in question is define in a script as follows:
public class NPC_Valkyrie : MonoBehaviour {
public enum ValkyrieStates {normal, happy, brunette, weird, happyweird};
public ValkyrieStates currentState;
For AOT platforms such as iOS is, you will need to please create the AOTClasses as explained in the documentation. Here is the link for your convenience: [LINK]
Before generating the AOTClasses as explained in the docs section linked above, you will need to add your custom types used if not already in the Preferred Types list. Thus for the error posted above, you will need to add the ‘Valkyrie.ValkyrieStates’ type in the list for example and then generating the AOTClasses.
Please let me know if that works for you, or if you need any further explanations.
Thank you.