NodeCanvas Forums › Support › WP8 crashes and exceptions with NC2.3.7 › Reply To: WP8 crashes and exceptions with NC2.3.7
Hello again,
I hate to be the bearer of bad news, but the fix didn’t work, but I also have more information for you. Let’s do things in order however.
Issue #1: I’m on Unity 5.1.2f1. Looking at my Player Settings to spot something that may influence that behaviour, I find that the “Api Compatibility Level” is set to “.Net 2.0 Subset”. I don’t really see anything else. This is a brand new project created from scratch to test these issues, so I haven’t messed with any settings really.
Ok, now Issue #2. I have made the change you suggested. However what you say was at line 95 (instance = Graph.Clone<Graph>(originalGraph)
) for me is at line 108. I am wondering if I have the right version of NC now… but I installed from the Asset Store a couple of days ago.
After the change, I still get an exception about “GetComponent” but from a different location:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.ni.dll A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in UnityEngine.DLL Exception: External component has thrown an exception. Type: System.Runtime.InteropServices.SEHException Module: UnityEngine InnerException: <No Data> AdditionalInfo:<No Data> at UnityEngine.Internal.$Calli.Invoke123(Int32 arg0, Int32 arg1, Boolean arg2, Boolean arg3, Boolean arg4, Boolean arg5, Int64 arg6, IntPtr method) at UnityEngine.GameObject.GetComponentsInternal(Type type, Boolean useSearchTypeAsArrayReturnType, Boolean recursive, Boolean includeInactive, Boolean reverse, Object resultList) at UnityEngine.GameObject.GetComponents[T]() at NodeCanvas.StateMachines.FSM.GatherDelegates() at NodeCanvas.StateMachines.FSM.OnGraphStarted() at NodeCanvas.Framework.Graph.StartGraph(Component agent, IBlackboard blackboard, Action' 1 callback) at NodeCanvas.Framework.GraphOwner' 1.StartBehaviour() at NodeCanvas.Framework.GraphOwner.Start() at NodeCanvas.Framework.GraphOwner.$Invoke21(Int64 instance, Int64* args) at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method) (Filename: Line: 0) SEHException: External component has thrown an exception. at UnityEngine.Internal.$Calli.Invoke123(Int32 arg0, Int32 arg1, Boolean arg2, Boolean arg3, Boolean arg4, Boolean arg5, Int64 arg6, IntPtr method) at UnityEngine.GameObject.GetComponentsInternal(Type type, Boolean useSearchTypeAsArrayReturnType, Boolean recursive, Boolean includeInactive, Boolean reverse, Object resultList) at UnityEngine.GameObject.GetComponents[T]() at NodeCanvas.StateMachines.FSM.GatherDelegates() at NodeCanvas.StateMachines.FSM.OnGraphStarted() at NodeCanvas.Framework.Graph.StartGraph(Component agent, IBlackboard blackboard, Action'1 callback) at NodeCanvas.Framework.GraphOwner'1.StartBehaviour() at NodeCanvas.Framework.GraphOwner.Start() at NodeCanvas.Framework.GraphOwner.$Invoke21(Int64 instance, Int64* args) at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method) (Filename: <Unknown> Line: 0) |
Sometime over the weekend, I had submitted a bug to Unity about this exact problem. Here is the answer they sent back:
Thank you for reporting the issue.
It appears that you are trying to call the method from the wrong thread. In order for the code to work you have to call it like this:
private void Unity_Loaded()
{UnityPlayer.UnityApp.BeginInvoke(() =>
{
//your code
});}
That makes some sense considering the exception call stack, but after a quick look, I can’t see where the original Invoke would be. Also, why does it even work in the editor/other_platforms it that is the case?
Cheers,
Alain-Daniel