FlowCanvas Forums › Support › NodeCanvas blackboard access from FlowCanvas issue.
I have a NodeCanvas FSM that as nodes containing FlowCanvas scripts. It works great in the editor, but when deploying to iOS I get:
NullReferenceException: A null value was found where an object instance was required.
at FlowCanvas.BinderConnection
1[T].UnBind () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Graph.RemoveConnection (NodeCanvas.Framework.Connection connection, Boolean recordUndo) [0x00000] in <filename unknown>:0
at FlowCanvas.FlowNode.ValidateConnections () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Graph.Validate () [0x00000] in <filename unknown>:0
at FlowCanvas.Nodes.ReflectedFunctionNode3[T1,T2,TResult].Call (.T1 a, .T2 b) [0x00000] in <filename unknown>:0
at FlowCanvas.ValueInput1[T].get_value () [0x00000] in <filename unknown>:0
2+<RegisterPorts>c__AnonStorey8D[T1,TResult].<>m__BD (Flow f) [0x00000] in <filename unknown>:0
at FlowCanvas.Nodes.ReflectedFunctionNode
at FlowCanvas.FlowOutput.Continue (Flow f) [0x00000] in <filename unknown>:0
at FlowCanvas.FlowOutput.Continue (Flow f) [0x00000] in <filename unknown>:0
at FlowCanvas.FlowOutput.Continue (Flow f) [0x00000] in <filename unknown>:0
at FlowCanvas.FlowOutput.Continue (Flow f) [0x00000] in <filename unknown>:0
at FlowCanvas.Nodes.Split+<RegisterPorts>c__AnonStorey79.<>m__9B (Flow f) [0x00000] in <filename unknown>:0
at FlowCanvas.FlowOutput.Continue (Flow f) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Graph.StartGraph (UnityEngine.Component agent, IBlackboard blackboard, System.Action1 callback) [0x00000] in <filename unknown>:0
3:Call(T1, T2)
at NodeCanvas.StateMachines.FSMState.OnExecute (UnityEngine.Component agent, IBlackboard bb) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.Node.Execute (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0
at NodeCanvas.StateMachines.FSM.EnterState (NodeCanvas.StateMachines.FSMState newState) [0x00000] in <filename unknown>:0
at NodeCanvas.StateMachines.FSMState.CheckTransitions () [0x00000] in <filename unknown>:0
at NodeCanvas.StateMachines.FSMState.Update () [0x00000] in <filename unknown>:0
at NodeCanvas.StateMachines.FSM.OnGraphUpdate () [0x00000] in <filename unknown>:0
at ParadoxNotion.Services.MonoManager.Update () [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.IBlackboard.GetValue[T] (System.String varName) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.IBlackboard.GetValue[T] (System.String varName) [0x00000] in <filename unknown>:0
at NodeCanvas.Framework.IBlackboard.GetValue[T] (System.String varName) [0x00000] in <filename unknown>:0
FlowCanvas.Nodes.ReflectedFunctionNode
FlowCanvas.ValueInput1:get_value()
1)
FlowCanvas.Nodes.<RegisterPorts>c__AnonStorey8D:<>m__BD(Flow)
FlowCanvas.FlowOutput:Continue(Flow)
FlowCanvas.FlowOutput:Continue(Flow)
FlowCanvas.FlowOutput:Continue(Flow)
FlowCanvas.FlowOutput:Continue(Flow)
FlowCanvas.Nodes.<RegisterPorts>c__AnonStorey79:<>m__9B(Flow)
FlowCanvas.FlowOutput:Continue(Flow)
NodeCanvas.Framework.Graph:StartGraph(Component, IBlackboard, Action
NodeCanvas.StateMachines.FSMState:OnExecute(Component, IBlackboard)
NodeCanvas.Framework.Node:Execute(Component, IBlackboard)
NodeCanvas.StateMachines.FSM:EnterState(FSMState)
NodeCanvas.StateMachines.FSMState:CheckTransitions()
NodeCanvas.StateMachines.FSMState:Update()
NodeCanvas.StateMachines.FSM:OnGraphUpdate()
ParadoxNotion.Services.MonoManager:Update()
NodeCanvas.Framework.IBlackboard:GetValue(String)
NodeCanvas.Framework.IBlackboard:GetValue(String)
NodeCanvas.Framework.IBlackboard:GetValue(String)
(Filename: currently not available on il2cpp Line: -1)`
I think the issue has something to do with blackboard variables on the parent node canvas FSM that the flowcanvas is trying to get. The flow canvas node is reading three variables from the node canvas FSM, that is why “NodeCanvas.Framework.IBlackboard:GetValue(String)” is shown three times.
Any thoughts as to what is causing this to fail on iOS, or how to fix it?
Thanks
Hello,
Hmm. Before I go digging this further, can you please let me know if you have you generated the AOTClasses.cs file from within the Preferred Types Editor relevant button?
Let me know. Thanks.
Join us on Discord: https://discord.gg/97q2Rjh
Yes I generated that file. I did have to do a find/replace in the fie it was generating lines with “DOTweenSettings+SettingsLocation” instead of “DOTweenSettings.SettingsLocation”. But after that it compiled without error.
Hello,
Thanks for the bug in generator about nested classes. I will fix this for the next version.
Regarding the issue, Are you using IL2CPP backend? Does this problem takes place when using Mono scripting backend?
Let me know.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh
Using IL2CPP. After a lot of digging around I finally found what is causing it. I attached the part that is causing the issue. OnAwake works fine on both ios and pc. OnFixedUpdate is the part that works fine on PC but crashes ios. I’m guessing the null reference is for MyRigidbody, which is just a cached property set in OnAwake. Any thoughts as to why this would crash on ios?
Hello again,
Hmm. Have you tried using a GetComponent
Also it would be great if you can try using Mono scripting backend instead of IL2CPP to test if it is working? If yes, this can give us more leads to follow for this problem.
Thanks in advance!
Join us on Discord: https://discord.gg/97q2Rjh
Just tried GetComponent and that doesn’t work either. I also tried building in Mono and it crashes instantly on ios. I’m very lacking in my ios debugging, I can’t ever seem to find what is actually causing the issue. I’m attaching the ios crah stack, though I’m not sure it will be much help. Since GetComponent did not work, it makes me think I’m going down the wrong direction, but when I remove that OnFixedUpdate, it runs without issue, so it must be something in there causing it. I’ll keep digging.