No AOT code generated for event on iOS

NodeCanvas Forums Support No AOT code generated for event on iOS

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13192
    sasharb
    Participant

    Hi!

    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.Variable
    1[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.Variable
    1[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;

    Attachments:
    You must be logged in to view attached files.
    #13195
    Gavalakis
    Keymaster

    Hello,

    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.

    Join us on Discord: https://discord.gg/97q2Rjh

    #13196
    sasharb
    Participant

    Oh, I did add Valkyria Class in the Preferred Types Editor, but not the enum. Now it works, thank you!

    #13217
    Gavalakis
    Keymaster

    Awesome. Thanks for the follow up. I am glad it works for you now 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.