I have this very strange problem with my code, and this is a fairly new problem, given that I did not have it six months ago. In short, I made an app in Xamarin and released it about half a year ago in all 3 stores (App Store, Google Play, and Microsoft Store).
Yesterday, the user reported a problem with the Android application, and after I received the fix and recompiled, now I am facing a new error with Json.NET
The exception is
Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type Rowlog.Common.Dtos.CompressedTripData. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'tripCoordinates', line 1, position 19.
And before you ask, yes, Rowlog.Common.Dtos.CompressedTripData really has a constructor without parameters (well, it doesn’t have one at all, that we all know, it's the same thing).
And, as I said, this is when I download the CompressedTripData object from the server to the Android device. Downloading the same object on iOS and Windows Phone works smoothly. I guess this should be the last change in Json.NET or Xamarin.Android that causes this (other applications still use the Json.NET libraries about six months ago. Not sure if any updates have been made to it since)
Has anyone else encountered a similar problem, and if so, how did you fix it?
source share