trilitech / tezos-unity-sdk

Tezos Unity SDK for developers. Discover the future of Web3 gaming.
https://tezos.com/unity
MIT License
24 stars 12 forks source link

Unable to find a constructor to use for type MatrixServerVersionsResponse #90

Closed fraidev closed 1 year ago

fraidev commented 1 year ago

When using the SDK on iOS, I get a JSON serialization error.

JsonSerializationException: Unable to find a constructor to use for type Matrix.Sdk.Core.Infrastructure.Dto.ClientVersion.MatrixServerVersionsResponse. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'versions', line 1, position 12.

I think this is the reason because iOS authentication is buggy.

~I think that we need to put a default constructor here: Matrix.Sdk/Core/Infrastructure/Dto/ClientVersion/MatrixServerVersionsResponse.cs~

Edit: Actually, changing Managed Stripping Level from Low to Minimal fix it! image

Maybe we should add a link.xml in the sample folder to force it or write in the README that only works on iOS with Managed Stripping Level selected to Minimal.

fraidev commented 1 year ago

I added a PR that will fix it for imported samples #91.

But this will still happen for who only uses SDK without importing samples.

I think that we need to improve documentation about it or create a preprocessor to do it: https://forum.unity.com/threads/the-current-state-of-link-xml-in-packages.995848/#post-7223887

k-karuna commented 1 year ago

@fraidev thanks for investigation. By default in my Unity ver (2021.3.27f) is set Managed Stripping Level by default to Disabled, thereby i haven't faced this issue. But when i switch to any different value, i'm receiving following error during building Android

Fatal error in Unity CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Newtonsoft.Json, Version=13.0.0.0.

So, i would to suggest update Readme to disable Managed Stripping Level on mobile platforms.