NodeCanvas Forums › General Discussion › Infinite Error on IOS build.
Tagged: infinite loop, IOS
Hi,
I’m using Unity 5.4.1p3 and NodeCanvas 2.6.0b and I’ve got a following error when I build the app for IOS device which seems to be related to NodeCanvas. It works on fine on Unity Editor but once it’s been built for IOS it won’t work any more.
What seems to be the problem and is there any way to fix this issue?
Just for your info I have already generated AOTClasses.cs and the script backend is IL2CPP.
Thank you,
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 37 38 |
(Filename: Line: 386) init 0 UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) StoryManager:Start() (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42) NullReferenceException: A null value was found where an object instance was required. at System.Reflection.EventInfo.CreateAddEventDelegate (System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0 at System.Reflection.EventInfo.AddEventHandler (System.Object target, System.Delegate handler) [0x00000] in <filename unknown>:0 at NodeCanvas.Tasks.Conditions.CheckCSharpEvent.OnInit () [0x00000] in <filename unknown>:0 at NodeCanvas.Framework.Task.Initialize (UnityEngine.Component newAgent, System.Type newType) [0x00000] in <filename unknown>:0 at NodeCanvas.Framework.Task.Set (UnityEngine.Component newAgent, IBlackboard newBB) [0x00000] in <filename unknown>:0 at NodeCanvas.Framework.ConditionTask.CheckCondition (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0 at NodeCanvas.BehaviourTrees.ConditionalEvaluator.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.BehaviourTrees.Selector.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.BehaviourTrees.BehaviourTree.Tick (UnityEngine.Component agent, IBlackboard blackboard) [0x00000] in <filename unknown>:0 (Filename: currently not available on il2cpp Line: -1) 2016-10-11 14:01:36.018834 tenshindo[11646:3344102] invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution. <b>Graph Error:</b> 'Infinite Loop. Please check for other errors that may have caused this in the log.' On node 'SELECTOR' ID 1 | On graph 'BehaviourTree' UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) NodeCanvas.Framework.Node:Execute(Component, IBlackboard) NodeCanvas.BehaviourTrees.BehaviourTree:Tick(Component, IBlackboard) (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42) <b>Graph Error:</b> 'Infinite Loop. Please check for other errors that may have caused this in the log.' On node 'SELECTOR' ID 1 | On graph 'BehaviourTree' UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) NodeCanvas.Framework.Node:Execute(Component, IBlackboard) NodeCanvas.BehaviourTrees.BehaviourTree:Tick(Component, IBlackboard) |
After debugging for while I found out that these errors occurs whenever I use Check CSharp Event for Decorator in Common section. Is this a bug or is there any specific way to use CSharp Event for IOS device?
Hello,
Hmm. I will investigate this further to see what might be the issue here. Does this work with Mono backend?
Join us on Discord: https://discord.gg/97q2Rjh
I haven’t tried with mono backend since I believe I have to use IL2CPP in order to submit to the app store.
Hello again,
Please try and open up CheckCSharpEvent.cs script and change the code starting in line #45 to the following:
1 2 3 4 5 6 7 |
var methodInfo = this.GetType().RTGetMethod("Raised"); var handler = methodInfo.RTCreateDelegate(eventInfo.EventHandlerType, this); eventInfo.AddEventHandler(agent, handler); return null; } |
Also please do the same in line #136 for the generic version of the task:
1 2 3 4 5 6 7 |
var methodInfo = this.GetType().RTGetMethod("Raised"); var handler = methodInfo.RTCreateDelegate(eventInfo.EventHandlerType, this); eventInfo.AddEventHandler(agent, handler); return null; } |
Please let me know if everything works after this change.
If you need any help with applying those changes, let me know and I can send you the full script to your email.
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Hey Guys,
Sorry to resurrect an old thread, but did you ever figure out the cause of this null reference? I am having the same issue and I have applied your code changes above. I am currently running on Unity 5.4.2 and Node Canvas version 2.6.0b.
Thanks.
Hello,
No problem. Are you referring to error in iOS when using CheckCSharpEvent like the OP post stated?
Can you please try and make the method “Raised” in CheckCSharpEvent.cs public (it’s private right now) and let me know if that helps?
Thanks in advance.
Join us on Discord: https://discord.gg/97q2Rjh