I'm working on a Unity project for the Hololens 2 which serializes user data and saves it as a json file to be accessed again later. What I have currently works fine when emulating in Unity but on the Hololens itself I get the following error when serializing:
ExecutionEngineException: Attempting to call method 'System.Runtime.Serialization.XmlObjectSerializerWriteContext::IncrementCollectionCountGeneric<UnityEngine.Vector3>' for which no ahead of time (AOT) code was generated.
After some testing I've found that my code works fine on the Hololens as long as I don't use any Vector3's which makes sense considering the error above. The issue I'm having is when Vector3 is being serialized in the json file it will simply cut off and leave incomplete json. I assume the issue is because of the missing method for serializing Vector3's when building for the Hololens (UWP).
How should I go about handling this from here?