Issue #156 resolved
Former user created an issue

Hi,

I am getting the following exception and my game stops working on IOS. Works OK on Android btw.

ExecutionEngineException: Attempting to call method 'Sirenix.Serialization.DictionaryFormatter`2[[System.String, mscorlib, Version=2.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089],[UnityEngine.Vector3, UnityEngine, Version=0.0.0.0, Culture=, PublicKeyToken=null]]::.cctor' for which no ahead of time (AOT) code was generated.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.CreateFormatter (System.Type type, ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.GetFormatter (System.Type type, ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.GetFormatter[T] (ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.ComplexTypeSerializer`1[T].ReadValue (IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1& referencedUnityObjects, DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, SerializationData& data, Sirenix.Serialization.DeserializationContext context, Boolean isPrefabData) [0x00000] in <filename unknown>:0 
  at Sirenix.OdinInspector.SerializedMonoBehaviour.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0 
Rethrow as TypeInitializationException: The type initializer for 'Sirenix.Serialization.DictionaryFormatter<System.String,UnityEngine.Vector3>' threw an exception.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.CreateFormatter (System.Type type, ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.GetFormatter (System.Type type, ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.GetFormatter[T] (ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.ComplexTypeSerializer`1[T].ReadValue (IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1& referencedUnityObjects, DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, SerializationData& data, Sirenix.Serialization.DeserializationContext context, Boolean isPrefabData) [0x00000] in <filename unknown>:0 
  at Sirenix.OdinInspector.SerializedMonoBehaviour.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.CreateFormatter (System.Type type, ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.GetFormatter (System.Type type, ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.FormatterLocator.GetFormatter[T] (ISerializationPolicy policy) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.ComplexTypeSerializer`1[T].ReadValue (IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1& referencedUnityObjects, DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, SerializationData& data, Sirenix.Serialization.DeserializationContext context, Boolean isPrefabData) [0x00000] in <filename unknown>:0 
  at Sirenix.OdinInspector.SerializedMonoBehaviour.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0 
Sirenix.Serialization.ComplexTypeSerializer`1:ReadValue(IDataReader)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, Byte[]&, List`1&, DataFormat, DeserializationContext)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean)
Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()

(Filename: currently not available on il2cpp Line: -1)

InvalidOperationException: Invalid binary data stream: could not parse peeked BinaryEntryType byte '0' into a known entry type.
  at Sirenix.Serialization.BinaryDataReader.PeekEntry (System.String& name) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.BinaryDataReader.ReadToNextEntry () [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.BaseDataReader.SkipEntry () [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.BinaryDataReader.ExitNode () [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.ComplexTypeSerializer`1[T].ReadValue (IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1& referencedUnityObjects, DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, SerializationData& data, Sirenix.Serialization.DeserializationContext context, Boolean isPrefabData) [0x00000] in <filename unknown>:0 
  at Sirenix.OdinInspector.SerializedMonoBehaviour.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0 
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, Byte[]&, List`1&, DataFormat, DeserializationContext)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean)
Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()

(Filename: currently not available on il2cpp Line: -1)

Entry of type "Invalid" in node "SceneCameraPositions" is missing a name.
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, Byte[]&, List`1&, DataFormat, DeserializationContext)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean)
Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

InvalidOperationException: Invalid binary data stream: could not parse peeked BinaryEntryType byte '0' into a known entry type.
  at Sirenix.Serialization.BinaryDataReader.PeekEntry (System.String& name) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.BinaryDataReader.ReadToNextEntry () [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.BaseDataReader.SkipEntry () [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, IDataReader reader) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1& referencedUnityObjects, DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <filename unknown>:0 
  at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, SerializationData& data, Sirenix.Serialization.DeserializationContext context, Boolean isPrefabData) [0x00000] in <filename unknown>:0 
  at Sirenix.OdinInspector.SerializedMonoBehaviour.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <filename unknown>:0 

(Filename: currently not available on il2cpp Line: -1)

Comments (3)

  1. Bjarke Elias
    • changed status to open

    Hi, thanks for the log.

    It seems we are fighting the code-stripper, which optimizes our types out of existence.

    Try replacing all of the contents of the link.xml file located in the Plugins/Sirenix/Assemblies folder file with the following:

    <linker>
      <assembly fullname="Sirenix.Serialization.Config">
        <type fullname="CustomLogger" preserve="all" />
        <type fullname="DataFormat" preserve="all" />
        <type fullname="DefaultLoggers" preserve="all" />
        <type fullname="ErrorHandlingPolicy" preserve="all" />
        <type fullname="GlobalSerializationConfig" preserve="all" />
        <type fullname="ILogger" preserve="all" />
        <type fullname="LoggingPolicy" preserve="all" />
      </assembly>
      <assembly fullname="Sirenix.Serialization">
        <type fullname="AlwaysFormatsSelfAttribute" preserve="all" />
        <type fullname="AnimationCurveFormatter" preserve="all" />
        <type fullname="ArrayFormatter`1" preserve="all" />
        <type fullname="ArrayListFormatter" preserve="all" />
        <type fullname="BaseDataReader" preserve="all" />
        <type fullname="BaseDataReaderWriter" preserve="all" />
        <type fullname="BaseDataWriter" preserve="all" />
        <type fullname="BaseFormatter`1" preserve="all" />
        <type fullname="BinaryDataReader" preserve="all" />
        <type fullname="BinaryDataWriter" preserve="all" />
        <type fullname="BinaryEntryType" preserve="all" />
        <type fullname="BooleanSerializer" preserve="all" />
        <type fullname="BoundsFormatter" preserve="all" />
        <type fullname="Buffer`1" preserve="all" />
        <type fullname="ByteSerializer" preserve="all" />
        <type fullname="CachedMemoryStream" preserve="all" />
        <type fullname="CharSerializer" preserve="all" />
        <type fullname="Color32Formatter" preserve="all" />
        <type fullname="ColorBlockFormatter" preserve="all" />
        <type fullname="ColorFormatter" preserve="all" />
        <type fullname="ComplexTypeSerializer`1" preserve="all" />
        <type fullname="CustomFormatterAttribute" preserve="all" />
        <type fullname="CustomGenericFormatterAttribute" preserve="all" />
        <type fullname="CustomSerializationPolicy" preserve="all" />
        <type fullname="DateTimeFormatter" preserve="all" />
        <type fullname="DateTimeOffsetFormatter" preserve="all" />
        <type fullname="DebugContext" preserve="all" />
        <type fullname="DecimalByteUnion" preserve="all" />
        <type fullname="DecimalSerializer" preserve="all" />
        <type fullname="DefaultSerializationBinder" preserve="all" />
        <type fullname="DelegateFormatter`1" preserve="all" />
        <type fullname="DeserializationContext" preserve="all" />
        <type fullname="DictionaryFormatter`2" preserve="all" />
        <type fullname="DoubleByteUnion" preserve="all" />
        <type fullname="DoubleSerializer" preserve="all" />
        <type fullname="EasyBaseFormatter`1" preserve="all" />
        <type fullname="EmptyTypeFormatter`1" preserve="all" />
        <type fullname="EntryType" preserve="all" />
        <type fullname="EnumSerializer`1" preserve="all" />
        <type fullname="ExcludeDataFromInspectorAttribute" preserve="all" />
        <type fullname="FormatterEmitter" preserve="all" />
        <type fullname="FormatterLocator" preserve="all" />
        <type fullname="FormatterUtilities" preserve="all" />
        <type fullname="GenericCollectionFormatter" preserve="all" />
        <type fullname="GenericCollectionFormatter`2" preserve="all" />
        <type fullname="GradientAlphaKeyFormatter" preserve="all" />
        <type fullname="GradientColorKeyFormatter" preserve="all" />
        <type fullname="GradientFormatter" preserve="all" />
        <type fullname="GuidByteUnion" preserve="all" />
        <type fullname="GuidSerializer" preserve="all" />
        <type fullname="HashSetFormatter`1" preserve="all" />
        <type fullname="IDataReader" preserve="all" />
        <type fullname="IDataWriter" preserve="all" />
        <type fullname="IExternalGuidReferenceResolver" preserve="all" />
        <type fullname="IExternalIndexReferenceResolver" preserve="all" />
        <type fullname="IExternalStringReferenceResolver" preserve="all" />
        <type fullname="IFormatter" preserve="all" />
        <type fullname="IFormatter`1" preserve="all" />
        <type fullname="InspectorSerializationUtility" preserve="all" />
        <type fullname="Int16Serializer" preserve="all" />
        <type fullname="Int32Serializer" preserve="all" />
        <type fullname="Int64Serializer" preserve="all" />
        <type fullname="IntPtrSerializer" preserve="all" />
        <type fullname="IOverridesSerializationFormat" preserve="all" />
        <type fullname="ISelfFormatter" preserve="all" />
        <type fullname="ISerializationPolicy" preserve="all" />
        <type fullname="ISupportsPrefabSerialization" preserve="all" />
        <type fullname="JsonConfig" preserve="all" />
        <type fullname="JsonDataReader" preserve="all" />
        <type fullname="JsonDataWriter" preserve="all" />
        <type fullname="JsonTextReader" preserve="all" />
        <type fullname="KeyframeFormatter" preserve="all" />
        <type fullname="LayerMaskFormatter" preserve="all" />
        <type fullname="ListFormatter`1" preserve="all" />
        <type fullname="MinimalBaseFormatter`1" preserve="all" />
        <type fullname="MultiDimensionalArrayFormatter`2" preserve="all" />
        <type fullname="NodeInfo" preserve="all" />
        <type fullname="NullableFormatter`1" preserve="all" />
        <type fullname="OdinSerializeAttribute" preserve="all" />
        <type fullname="PreEmittedFormatter`1" preserve="all" />
        <type fullname="PrefabModification" preserve="all" />
        <type fullname="PrefabModificationType" preserve="all" />
        <type fullname="PreviouslySerializedAsAttribute" preserve="all" />
        <type fullname="PrimitiveArrayFormatter`1" preserve="all" />
        <type fullname="ProperBitConverter" preserve="all" />
        <type fullname="QuaternionFormatter" preserve="all" />
        <type fullname="ReadDataEntryMethodDelegate`1" preserve="all" />
        <type fullname="RectFormatter" preserve="all" />
        <type fullname="ReflectionFormatter`1" preserve="all" />
        <type fullname="RuntimeEmittedFormatter`1" preserve="all" />
        <type fullname="SByteSerializer" preserve="all" />
        <type fullname="SelectionTracker" preserve="all" />
        <type fullname="SelfFormatterFormatter`1" preserve="all" />
        <type fullname="SerializableFormatter`1" preserve="all" />
        <type fullname="SerializationAbortException" preserve="all" />
        <type fullname="SerializationConfig" preserve="all" />
        <type fullname="SerializationContext" preserve="all" />
        <type fullname="SerializationData" preserve="all" />
        <type fullname="SerializationNode" preserve="all" />
        <type fullname="SerializationNodeDataReader" preserve="all" />
        <type fullname="SerializationNodeDataReaderWriterConfig" preserve="all" />
        <type fullname="SerializationNodeDataWriter" preserve="all" />
        <type fullname="SerializationPolicies" preserve="all" />
        <type fullname="SerializationUtility" preserve="all" />
        <type fullname="SerializedBehaviour" preserve="all" />
        <type fullname="SerializedComponent" preserve="all" />
        <type fullname="SerializedMonoBehaviour" preserve="all" />
        <type fullname="SerializedNetworkBehaviour" preserve="all" />
        <type fullname="SerializedScriptableObject" preserve="all" />
        <type fullname="SerializedStateMachineBehaviour" preserve="all" />
        <type fullname="SerializedUnityObject" preserve="all" />
        <type fullname="Serializer" preserve="all" />
        <type fullname="Serializer`1" preserve="all" />
        <type fullname="SingleByteUnion" preserve="all" />
        <type fullname="SingleSerializer" preserve="all" />
        <type fullname="StringSerializer" preserve="all" />
        <type fullname="TimeSpanFormatter" preserve="all" />
        <type fullname="TwoWaySerializationBinder" preserve="all" />
        <type fullname="TypeFormatter" preserve="all" />
        <type fullname="UInt16Serializer" preserve="all" />
        <type fullname="UInt32Serializer" preserve="all" />
        <type fullname="UInt64Serializer" preserve="all" />
        <type fullname="UIntPtrSerializer" preserve="all" />
        <type fullname="UnityEventFormatter" preserve="all" />
        <type fullname="UnityEventFormatter`1" preserve="all" />
        <type fullname="UnityReferenceResolver" preserve="all" />
        <type fullname="UnitySerializationInitializer" preserve="all" />
        <type fullname="UnitySerializationUtility" preserve="all" />
        <type fullname="Vector2Formatter" preserve="all" />
        <type fullname="Vector3Formatter" preserve="all" />
        <type fullname="Vector4Formatter" preserve="all" />
        <type fullname="WriteDataEntriesMethodDelegate`1" preserve="all" />
      </assembly>
      <assembly fullname="Sirenix.Utilities">
        <type fullname="ArrayUtilities" preserve="all" />
        <type fullname="AssemblyTypeFlags" preserve="all" />
        <type fullname="AssemblyUtilities" preserve="all" />
        <type fullname="AssetScriptGuidUtility" preserve="all" />
        <type fullname="Cache`1" preserve="all" />
        <type fullname="ColorExtensions" preserve="all" />
        <type fullname="ConditionFlags" preserve="all" />
        <type fullname="DeepReflection" preserve="all" />
        <type fullname="DelegateExtensions" preserve="all" />
        <type fullname="DictionaryIterator`2" preserve="all" />
        <type fullname="DictionaryValueIterator`2" preserve="all" />
        <type fullname="DirectoryInfoExtensions" preserve="all" />
        <type fullname="DoubleLookupDictionary`3" preserve="all" />
        <type fullname="DrawUnityEditorInGlobalConfigWindowAttribute" preserve="all" />
        <type fullname="EditorGlobalConfigAttribute" preserve="all" />
        <type fullname="EmitUtilities" preserve="all" />
        <type fullname="FieldInfoExtensions" preserve="all" />
        <type fullname="Flags" preserve="all" />
        <type fullname="GarbageFreeIterators" preserve="all" />
        <type fullname="GlobalConfig`1" preserve="all" />
        <type fullname="GlobalConfigAttribute" preserve="all" />
        <type fullname="GUILayoutOptions" preserve="all" />
        <type fullname="GUILayoutOptionsInstance" preserve="all" />
        <type fullname="GUILayoutOptionType" preserve="all" />
        <type fullname="HashsetIterator`1" preserve="all" />
        <type fullname="ICache`1" preserve="all" />
        <type fullname="ICacheNotificationReceiver" preserve="all" />
        <type fullname="IImmutableList" preserve="all" />
        <type fullname="IImmutableList`1" preserve="all" />
        <type fullname="ImmutableHashSet`1" preserve="all" />
        <type fullname="ImmutableList" preserve="all" />
        <type fullname="ImmutableList`1" preserve="all" />
        <type fullname="ImmutableList`2" preserve="all" />
        <type fullname="LinqExtensions" preserve="all" />
        <type fullname="ListExtensions" preserve="all" />
        <type fullname="ListIterator`1" preserve="all" />
        <type fullname="MathUtilities" preserve="all" />
        <type fullname="MemberAliasFieldInfo" preserve="all" />
        <type fullname="MemberAliasMethodInfo" preserve="all" />
        <type fullname="MemberAliasPropertyInfo" preserve="all" />
        <type fullname="MemberFinder" preserve="all" />
        <type fullname="MemberFinderExtensions" preserve="all" />
        <type fullname="MemberInfoExtensions" preserve="all" />
        <type fullname="MethodInfoExtensions" preserve="all" />
        <type fullname="Operator" preserve="all" />
        <type fullname="PathStep" preserve="all" />
        <type fullname="PathStepType" preserve="all" />
        <type fullname="PersistentAssemblyAttribute" preserve="all" />
        <type fullname="ProjectPathFinder" preserve="all" />
        <type fullname="PropertyInfoExtensions" preserve="all" />
        <type fullname="RectExtensions" preserve="all" />
        <type fullname="SirenixAssetPaths" preserve="all" />
        <type fullname="SirenixEditorConfigAttribute" preserve="all" />
        <type fullname="SirenixGlobalConfigAttribute" preserve="all" />
        <type fullname="StringExtensions" preserve="all" />
        <type fullname="TypeExtensions" preserve="all" />
        <type fullname="UnityExtensions" preserve="all" />
        <type fullname="UnityVersion" preserve="all" />
        <type fullname="UnsafeUtilities" preserve="all" />
        <type fullname="ValueGetter`2" preserve="all" />
        <type fullname="ValueSetter`2" preserve="all" />
        <type fullname="WeakValueGetter" preserve="all" />
        <type fullname="WeakValueGetter`1" preserve="all" />
        <type fullname="WeakValueSetter" preserve="all" />
        <type fullname="WeakValueSetter`1" preserve="all" />
      </assembly>
      <assembly fullname="Sirenix.OdinInspector.Attributes" preserve="all" />
      <assembly fullname="Sirenix.Serialization.Config" preserve="all" />
      <assembly fullname="Sirenix.Serialization" preserve="all" />
      <assembly fullname="Sirenix.Utilities" preserve="all" />
    </linker>
    
  2. Log in to comment