title: Xamarin - Json Deserialization not working on exported Android apk
body: <p><br>
  I have a project with a User model class that has 4 object lists (Ambiente, Empresa, Filial e Projeto).
  When I get the Json data from a webservice (using Newtonsoft.Json), the json code is correct, but when deserializing these lists of objects, they always came out null in the User class.<br>
  After setting the link to SDK Only, using [Preserve (AllMembers = true)], when running the project in Release and Debug, deserialization works correctly.</p>
  
  <p>I've also added this in android MainActivity, in the OnCreate method:</p>
  
  <pre>
  
      protected override void OnCreate(Bundle bundle)
      {
          TabLayoutResource = Resource.Layout.Tabbar;
          ToolbarResource = Resource.Layout.Toolbar;
          if (falseFlag) {
              var falseJC = new Newtonsoft.Json.Converters.BinaryConverter();
          }
          base.OnCreate(bundle);
      }
  
  </pre>
  
  <p>This is the User class, and the objects list:</p>
  
  <pre>
  
      [Preserve(AllMembers = true)]
          public class Usuario
          {
              public string Login { get; set; }
              public int SessionId { get; set; }
              public string Nome { get; set; }
              public string Email { get; set; }
              public int EmpresaId { get; set; }
              public int FilialId { get; set; }
              public int ProjetoId { get; set; }
              public DateTime DataLogin { get; set; }
              public object Matricula { get; set; }
              public object Server { get; set; }
              public string Senha { get; set; }
              public string Ambiente { get; set; }
              public string Idioma { get; set; }
              public string Device { get; set; }
              public string Acesso { get; set; }
              public string AmbienteSelecionado { get; set; }
  
              [JsonProperty(PropertyName = "AMBIENTES")]
              public List Ambientes { get; set; }
  
              public List Empresas { get; set; }
              public List Filiais { get; set; }
              public List Projetos { get; set; }
          }
  
          [Preserve(AllMembers = true)]
          public class Ambiente
          {
              [JsonProperty(PropertyName = "SGENVIRONMENT")]
              public string AmbienteId { get; set; }
  
              [JsonProperty(PropertyName = "DSENVIRONMENT")]
              public string AmbienteNome { get; set; }
          }
  
          [Preserve(AllMembers = true)]
          public class Empresa
          {
              public int EmpresaId { get; set; }
              public string RazaoSocial { get; set; }
          }
  
          [Preserve(AllMembers = true)]
          public class Filial
          {
              public int FilialId { get; set; }
              public int EmpresaId { get; set; }
              public string Titulo { get; set; }
          }
  
          [Preserve(AllMembers = true)]
          public class Projeto
          {
              public int ProjetoId { get; set; }
              public string Titulo { get; set; }
              public int EmpresaId { get; set; }
              public int FilialId { get; set; }
          }
  
  </pre>
  
  <p>And this is where the json is deserialized:</p>
  
  <pre>
  
      Usuario jsonUsuario = JsonConvert.DeserializeObject(json.message.ToString()); 
  
  </pre>
  
  <p>A week ago, before even doing this code, the deserialization worked. Then it suddenly stopped working on any situation, without changing any code.<br>
  Then I made all these changes above, making the deserialization work on Release / Debug on Visual Studio, but when exporting the apk and running it, the objects are still Null.</p>
  
  <p>When using a TraceWriter to intercept the deserialization, the log shows this:</p>
  
  <pre>
  2020-06-04T18:03:27.142 Info Unable to deserialize value to non-writable property 'Ambientes' on Gestor_Coletor_A.Models.Usuario. Path 'Ambientes', line 1, position 289.<br>
  2020-06-04T18:03:27.161 Info Unable to deserialize value to non-writable property 'Empresas' on Gestor_Coletor_A.Models.Usuario. Path 'Empresas', line 1, position 560.<br>
  2020-06-04T18:03:27.171 Info Unable to deserialize value to non-writable property 'Filiais' on Gestor_Coletor_A.Models.Usuario. Path 'Filiais', line 1, position 838.<br>
  2020-06-04T18:03:27.182 Info Unable to deserialize value to non-writable property 'Projetos' on Gestor_Coletor_A.Models.Usuario. Path 'Projetos', line 1, position 1100.
  </pre>
  
  <p>Why the object lists are considered "non-writable property"? They are all public, no private variable is being used.<br>
  What I'm doing wrong?<br>
  I must make it work on exported apk.<br>
  Any help would be appreciated.<br></p>
  
  <p>Thanks.</p>