ExecutionEngineException: Attempting to call method

When build IL2CPP and start project on device (Android/IOS) get error:

ExecutionEngineException: Attempting to call method ‘Unity.VisualScripting.InstanceFunctionInvoker5[[UnityEngine.XR.ARFoundation.ARPlaneManager, Unity.XR.ARFoundation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[UnityEngine.Ray, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[UnityEngine.XR.ARSubsystems.TrackableType, Unity.XR.ARSubsystems, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[Unity.Collections.Allocator, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[Unity.Collections.NativeArray1[[UnityEngine.XR.ARSubsystems.XRRaycastHit, Unity.XR.ARSubsystems, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor’ for which no ahead of time (AOT) code was generated.

My UVS looks like this:

Unity 2021.3.16f1
VisualScripting 1.7.8
ARFoundtation 4.2.7

Force the package update to UVS 1.8.0 in the package manager manifest.json. It should be fixed in that update.

All work perfect on 1.8.0 version. Thank you!

I encountered the same error using Google.Protobuf, building an Android package runtime with IL2Cpp
error:
ExecutionEngineException: Attempting to call method ‘Google.Protobuf.Reflection.ReflectionUtil+ExtensionReflectionHelper`2[[Google.Protobuf.Reflection.FieldOptions, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[Google.Api.FieldBehavior, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor’ for which no ahead of time (AOT) code was generated.

System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object parameters, System.Boolean wrapExceptions) (at <00000000000000000000000000000000>:0)
System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object args, System.Globalization.CultureInfo culture, System.Object activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <00000000000000000000000000000000>:0)
System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object args, System.Globalization.CultureInfo culture, System.Object activationAttributes) (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.ReflectionUtil.CreateExtensionHelper (Google.Protobuf.Extension extension) (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.ExtensionAccessor..ctor (Google.Protobuf.Reflection.FieldDescriptor descriptor) (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.FieldDescriptor.CreateAccessor () (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.FieldDescriptor.CrossLink () (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.ExtensionCollection.CrossLink () (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.FileDescriptor.BuildFrom (Google.Protobuf.ByteString descriptorData, Google.Protobuf.Reflection.FileDescriptorProto proto, Google.Protobuf.Reflection.FileDescriptor dependencies, System.Boolean allowUnknownDependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.FileDescriptor.FromGeneratedCode (System.Byte descriptorData, Google.Protobuf.Reflection.FileDescriptor dependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) (at <00000000000000000000000000000000>:0)
Google.Api.FieldBehaviorReflection..cctor () (at <00000000000000000000000000000000>:0)
User.V1.StoryReflection..cctor () (at <00000000000000000000000000000000>:0)
User.V1.ChapterReflection..cctor () (at <00000000000000000000000000000000>:0)
User.V1.GetDataResp.get_Descriptor () (at <00000000000000000000000000000000>:0)
Google.Protobuf.JsonParser.Merge (Google.Protobuf.IMessage message, Google.Protobuf.JsonTokenizer tokenizer) (at <00000000000000000000000000000000>:0)
Google.Protobuf.JsonParser.Merge (Google.Protobuf.IMessage message, System.IO.TextReader jsonReader) (at <00000000000000000000000000000000>:0)
Google.Protobuf.JsonParser.Parse[T] (System.IO.TextReader jsonReader) (at <00000000000000000000000000000000>:0)
WebReqMgr+<>c__DisplayClass5_0.b__0 (Newtonsoft.Json.Linq.JObject json) (at <00000000000000000000000000000000>:0)
WebReqMgr+d__22.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object parameters, System.Boolean wrapExceptions) (at <00000000000000000000000000000000>:0)
System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object args, System.Globalization.CultureInfo culture, System.Object activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <00000000000000000000000000000000>:0)
System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object args, System.Globalization.CultureInfo culture, System.Object activationAttributes) (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.ReflectionUtil.CreateExtensionHelper (Google.Protobuf.Extension extension) (at <00000000000000000000000000000000>:0)
Google.Protobuf.Reflection.ExtensionAccessor..ctor (