Skip to content

Missing default constructor after using il2cpp #3

@wvdvegt

Description

@wvdvegt

When running the GameStorageClientAsset on .net 2.0 instead of the default .net 2.0 subset in Unity and targeting iOS the default constructor seems to be stripped by the c++ conversion.

When using the source code :

1.	ExecutionEngineException: Attempting to call method 'AssetPackage.GameStorageClientAsset+InternalXmlSerializer::Deserialize' for which no ahead of time (AOT) code was generated.
2.	  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
3.	  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
4.	  at AssetPackage.GameStorageClientAsset.DeserializeDataXml (ISerializer serializer, AssetPackage.Node root, System.String data, StorageLocations location, SerializingFormat format, System.Collections.Generic.List`1 enumeration) [0x00000] in <filename unknown>:0
5.	  at AssetPackage.GameStorageClientAsset.DeSerializeData (System.String model, System.String data, StorageLocations location, SerializingFormat format, System.Collections.Generic.List`1 enumeration) [0x00000] in <filename unknown>:0
6.	  at AssetPackage.GameStorageClientAsset.LoadData (System.String model, StorageLocations location, SerializingFormat format) [0x00000] in <filename unknown>:0

When using the DLLs : 
InvalidOperationException: AssetManagerPackage.RageVersionInfo cannot be serialized because it does not have a default public constructor
  at System.Xml.Serialization.ReflectionHelper.CheckSerializableType (System.Type type, Boolean allowPrivateConstructors) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] extraTypes, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000] in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) [0x00000] in <filename unknown>:0 
  at AssetManagerPackage.RageVersionInfo.LoadVersionInfo (System.String xml) [0x00000] in <filename unknown>:0 
  at AssetPackage.BaseAsset..ctor () [0x00000] in <filename unknown>:0 

See https://forum.unity.com/threads/unity-5-0-3f2-il2cpp-problem-attempting-to-call-method-system-reflection-monoproperty-getteradapt.332335/page-2#post-3252930

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions