JsonConvert.SerializeObject always return {} in XamarinForms

你。 提交于 2019-11-26 21:06:21

This is a known problem see https://developer.xamarin.com/guides/cross-platform/live/limitations/

Limited support for reflection (currently affects some popular NuGets, like SQLite and Json.NET). Other NuGets are still supported.

If you compile it to an APK it works fine on the actual device.

Also posted an issue here: https://github.com/JamesNK/Newtonsoft.Json/issues/1578

I tried setting up emulator on a fast machine and the serialize works! So it means it doesn't work when i run it on live player using my android phone. I will set this as an answer for now. if someone else posted on how to make it work on live player, i will set it as the correct answer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!