heroiclabs / nakama-unity

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

Assembly error when importing Nakama #78

Closed pnarimani closed 4 years ago

pnarimani commented 4 years ago

I used the released package on github page in Unity 2019.2.3. But I'm receiving this error:

Error: Could not load signature of Nakama.ClientExtensions:NewSocket due to: Could not resolve type with token 01000007 (from typeref, class/assembly Nakama.ISocket, Nakama, Version=2.3.1.0, Culture=neutral, PublicKeyToken=null) assembly:Nakama, Version=2.3.1.0, Culture=neutral, PublicKeyToken=null type:Nakama.ISocket member:(null) signature:<none>

How can I solve this?

novabyte commented 4 years ago

Hey @mnarimani I'll grab Unity 2019.2.3 and see what happens when the SDK is loaded.

pnarimani commented 4 years ago

@novabyte I found what was wrong with it. I'm using assembly definition files for my project. 3rd party libraries also need to use assembly definition files if you want to reference them. So I added an assembly definition file named "Nakama". That was the problem. There is a dll called "Nakama" inside the package. And compiler didn't know which Nakama assembly was correct. I renamed the assembly definition file and error went away.