Reply To: [NC2] AoT iOS Jit Error on Startup

NodeCanvas Forums Support [NC2] AoT iOS Jit Error on Startup Reply To: [NC2] AoT iOS Jit Error on Startup

#9797

I’ve made some progress, but things aren’t working completely.

One should be able to fix the error we’re seeing by forcing the compiler to create appropriate entries in the function table. Doing that is fairly easy; all you need is to explicitly call each function somewhere in your code with each type you’ll ever be calling. Ours kind of looks like this:

… and so on for every value-type in your graphs (i.e. Enums, structs, and anything else that’s passed by value).

You don’t even need to call RegisterTypesForAOT. Just having it in your compiled code will force the compiler to create the entries you need.

After adding this to our code, though, we’ve been getting a different error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.ExecutionEngineException: Attempting to JIT compile method ‘(wrapper runtime-invoke) <Module>:runtime_invoke_void_Rect*_single (UnityEngine.Rect*,intptr,intptr,intptr)’ while running with –aot-only.

at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
— End of inner exception stack trace —
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at ParadoxNotion.Serialization.FullSerializer.Internal.fsMetaProperty.Write (System.Object context, System.Object value) [0x00000] in <filename unknown>:0

Something similar happens to Keyframes as well. I’ll update again if we fix that.