itisnajim / SocketIOUnity

A Wrapper for socket.io-client-csharp to work with Unity.
MIT License
393 stars 67 forks source link

Import Errors #2

Closed Sarfraz-droid closed 2 years ago

Sarfraz-droid commented 2 years ago

Hi, I was trying to add SocketManager.cs from Samples~ but have been getting these errors.. what could be the possible fix? Thank You

image

itisnajim commented 2 years ago

Which version of Unity are you using? Try these suggestions:

M1ngXU commented 2 years ago

I had the same error, but using the .zip it still has the same errors? any way to fix them?

itisnajim commented 2 years ago

I made a video on how to get the simple folder working, using the previous commented instructions: https://share.vidyard.com/watch/F7cBZi1jG2mS4mb8AaVJBG? You may have the first #1 issue, check it too!

DuneZerna commented 2 years ago

Hi, I was trying to add SocketManager.cs from Samples~ but have been getting these errors.. what could be the possible fix? Thank You

image

It is a necessity for the import that you have Git installed on your computer. Maybe try that?

syedMohib44 commented 2 years ago

Having same issue with unity 2020.3.15f2. Does anyone got a fix yet?

M1ngXU commented 2 years ago

@syedMohib44 i couldn't get it working. though i did my own one (no ack, no file stuff, just simple sending)

syedMohib44 commented 2 years ago

@M1ngXU sounds awesome how did you do it can you please help me I have tried many things rn just sending will help alot

M1ngXU commented 2 years ago

@syedMohib44 main part: https://github.com/M1ngXU/Socket.IO-Unity/blob/master/Script/Socket.cs quite well documented

syedMohib44 commented 2 years ago

@syedMohib44 main part: https://github.com/M1ngXU/Socket.IO-Unity/blob/master/Script/Socket.cs quite well documented

Thanks man really appriacte it 👍

itisnajim commented 2 years ago

I did an update to support Unity with .Net Standard 2.1 (Unity >= 2021.2.0), I test it with the latest beta Unity 2022.1.0b2 and working fine now, check with yours and please tell me if everything is ok

brako commented 2 years ago

I have the same problem with .Net Standard 2.0.

After a little bit of research, System.Memory.dll require those dependencies:

System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3

But somehow NuGet will download the latest compatible version of them instead:

System.Buffers (>= 4.5.1)
System.Numerics.Vectors (>= 4.5.0)
System.Runtime.CompilerServices.Unsafe (>= 4.5.3)

More info here

For example we have the dll System.Runtime.CompilerServices.Unsafe (5.0.0.0) which is different from the required one (4.0.4.1)

You can disable the strong named references in Unity: In Project Settings > Player > Other Settings > disable Assembly Version Validation. (source)

I don't know if this is a good option to just ignore this problem. But I'm still stuck after that with a conflict between the Unity package Newtonsoft and the embedded one in SocketIOUnity

@itisnajim I followed exactly what you did in the video but I doesn't work (Unity 2020.3.27f1 LTS)

itisnajim commented 2 years ago

All needed libs now under the folder SocketIOUnity/libs/*