heroiclabs / nakama-unity

Unity client for Nakama server.
https://heroiclabs.com/docs/unity-client-guide
Other
411 stars 75 forks source link

Notifications from server fail in IL2CPP builds #106

Closed DaveOak closed 3 years ago

DaveOak commented 3 years ago

IL2CPP builds for Android and WebGL fail. Mono builds work ok on Android.

Calling nk.notifications_send from my LUA scripts triggers the Socket.ReceivedError handler with: System.MethodAccessException: Attempt to access method 'System.Collections.Generic.IEnumerable.GetEnumerator' on type 'System.Collections.Generic.List' failed.

This happens with version 4d4240c00ffd35733cb314c1ced6393a69208bdb of the plugin, but not the earlier release.

lugehorsam commented 3 years ago

@DaveOak that's odd because we haven't made changes to the socket or its data types in your new version.

What's your Unity version and just to be safe, do you have a log of the payload getting sent from the server?

lugehorsam commented 3 years ago

And finally, can you confirm that you've set the .NET4.6 scripting runtime version in your editor?

lugehorsam commented 3 years ago

@DaveOak I'm going to make a new release with new .dll's and a proper release tag in case anything went wrong during the monkey patch process.

DaveOak commented 3 years ago

Hi Luke

Sorry I didn’t get back, the switch over to Nakama has been manic.

Previously I installed the unity package (which worked), but for this update I used manifest.json. I deleted the Nakama folder from the project but I suppose there may have been something conflicting from the previous version still. I am currently using the unity package version which still has the timeout bug, but that affects far fewer users.

I’m using Unity 2020 so runtime 4.x is mandatory. I have tried it with API compatibility set to 2.0 and 4.x but they both gave the error.

The only thing that allowed the newer version to work correctly was running in in the IDE or building for android with the Mono scripting framework instead of IL2CPP.

Cheers Dave

On 18 Feb 2021, at 12:59, Luke notifications@github.com wrote:

@DaveOak https://github.com/DaveOak I'm going to make a new release with new .dll's and a proper release tag in case anything went wrong during the monkey patch process.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heroiclabs/nakama-unity/issues/106#issuecomment-781326302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7YAU7ZZ3VT4XHPBHMGQDDS7UFMBANCNFSM4XY3GBHQ.

lugehorsam commented 3 years ago

@DaveOak let's try updating to Nakama 2.7.1. In your manifest: "com.heroiclabs.nakama-unity": "https://github.com/heroiclabs/nakama-unity.git?path=/Packages/Nakama#v2.7.1"

lugehorsam commented 3 years ago

Closing due to a stale issue.