Search Unity

Question XML Serialization exception after migrating from 2019 to 2020

Discussion in 'Android' started by habitoti, Jul 30, 2021.

  1. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    141
    I finally migrated my project from 2019.4.28f1 to 2020.3.14f1. After cleaning up a few deprecations everything appeared to be back to normal, however deploying on Android, I am seeing now an issue with XML (de-) serialisation. I get a lot of exceptions like this:

    Code (csharp):
    1. NotSupportedException: Parent does not have a default constructor. The default constructor must be explicitly defined.
    2.  
    3.     at System.Reflection.Emit.TypeBuilder.DefineDefaultConstructor (System.Reflection.MethodAttributes attributes) [0x00070] in <1dc10152da894b47b8bbfed156e7b841>:0
    4.     at System.Xml.Serialization.XmlSerializationILGen.GenerateBaseSerializer (System.String baseSerializer, System.String readerClass, System.String writerClass, System.Xml.Serialization.CodeIdentifiers classes) [0x00103] in <d0db3f607625460db8f5df59fe982070>:0
    5.     at System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly (System.Xml.Serialization.XmlMapping[] xmlMappings, System.Type[] types, System.String defaultNamespace, System.Security.Policy.Evidence evidence) [0x002ed] in <d0db3f607625460db8f5df59fe982070>:0
    6.     at System.Xml.Serialization.TempAssembly..ctor (System.Xml.Serialization.XmlMapping[] xmlMappings, System.Type[] types, System.String defaultNamespace, System.String location, System.Security.Policy.Evidence evid
    These exceptions don’t occur when running in editor. I searched around, but haven’t found any concrete clue what the reason is and how to fix it. So any hint welcome!
     
    Last edited: Jul 31, 2021