Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonException: No parameterless constructor defined for 'Nethereum.Unity.RpcModel.RpcParametersJsonConverter'. #21

Open
pabloruiz55 opened this issue Apr 19, 2023 · 2 comments

Comments

@pabloruiz55
Copy link

pabloruiz55 commented Apr 19, 2023

Hi! I'm experimenting the following issue when building to Android. Note that when running the game on the Unity player everything works fine, but when running on the device (Samsung Galaxy s22+) nothing is. Also, if building it for desktop Windows standalone, it also does work fine.

When trying to read or write from a smart contract (or even just request the block number from the examples) I get the following error:

04-19 09:46:36.921 32219 32274 I Unity   : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
04-19 09:46:36.921 32219 32274 I Unity   :
04-19 09:46:36.941 32219 32274 E Unity   : JsonException: No parameterless constructor defined for 'Nethereum.Unity.RpcModel.RpcParametersJsonConverter'.
04-19 09:46:36.941 32219 32274 E Unity   :   at Newtonsoft.Json.Serialization.JsonTypeReflector+<>c__DisplayClass22_0.<GetCreator>b__0 (System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0
04-19 09:46:36.941 32219 32274 E Unity   :   at Newtonsoft.Json.Serialization.JsonTypeReflector.GetJsonConverter (System.Object attributeProvider) [0x00000] in <00000000000000000000000000000000>:0
04-19 09:46:36.941 32219 32274 E Unity   :   at Newtonsoft.Json.Serialization.DefaultContractResolver.SetPropertySettingsFromAttributes (Newtonsoft.Json.Serialization.JsonProperty property, System.Object attributeProvider, System.String name, System.Type declaringType, Newtonsoft.Json.MemberSerialization memberSerialization, System.Boolean& allowNonPublicAccess) [0x00000] in <00000000000000000000000000000000>:0
04-19 09:46:36.941 32219 32274 E Unity   :   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperty (System.Reflection.MemberInfo member, Newtonsoft.Json.MemberSerialization memberSerialization) [0x00000] in <00000000000000000000000000000

I've tried the following:

  • Using 2021.x / 2022.x / 2023.x unity versions
  • Using different versions and packages from the Nethereum releases.
  • Using either Tasks or Coroutines.

Any ideas? Thanks in advance.

@eastedgeZack
Copy link

Getting the same problem with Unity WebGL

@juanfranblanco
Copy link
Member

This is an issue with build code stripping set it to minimal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants