We’re trying to solve a mysterious lockup when we first initialize Nakama. We’re using 2.8.0, Unity 2019.2.14f1, and Unity Nakama SDK 2.3.2. We noticed this exception when we call:
await socket.ConnectAsync(session);
12-04 21:28:08.798 21371 21413 D Unity : Unable to lookup library path for ‘advapi32’, native render plugin support disabled.
12-04 21:28:08.799 21371 21413 E Unity : Unable to find advapi32
12-04 21:28:08.809 21371 21413 W Unity : Plugins: Couldn’t open advapi32, error: dlopen failed: library “advapi32” not found
Any ideas about this error and possible solutions? Thanks.
we’ve tried with 5f1 and 14f1 and we’re getting that exception on both versions. Our production CI builds are also throwing the exception so it seems it’s not related to the unity install.
Here’s the full stack:
12-05 17:26:20.960 3140 3183 E Unity : Unable to find advapi32
12-05 17:26:20.973 3140 3183 W Unity : Plugins: Couldn’t open advapi32, error: dlopen failed: library “advapi32” not found
12-05 17:26:20.973 3140 3183 W Unity : Microsoft.Win32.ManifestEtw:EventRegister(Guid&, EtwEnableCallback, Void*, Int64&)
12-05 17:26:20.973 3140 3183 W Unity : System.Diagnostics.Tracing.EventProvider:Register(Guid)
12-05 17:26:20.973 3140 3183 W Unity : System.Diagnostics.Tracing.EventSource:Initialize(Guid, String, String)
12-05 17:26:20.973 3140 3183 W Unity : System.Diagnostics.Tracing.EventSource:.ctor(EventSourceSettings, String)
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.Internal.Events:.cctor()
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.WebSocketClientOptions:.ctor()
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.Internal.Events:.cctor()
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.WebSocketClientFactory:GetStream(Guid, Boolean, Boolean, String, Int32, CancellationToken)
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.WebSocketClientOptions:.ctor()
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.Internal.Events:.cctor()
12-05 17:26:20.973 3140 3183 W Unity : Nakama.Ninja.WebSockets.WebSocketClientFactory:ConnectAsync(Uri, WebSocketClientOptions, CancellationToken)
12-05 17:26:20.973 3140 3183 W Unity : Nakama.WebSocketAdapter:ReadFrames(WebSocketReceiveResult, WebSocket, Byte)
12-05 17:26:20.973 3140 3183 W Unity : Nakama.ApiClient:ListUserGroupsAsync(String, String, Nullable1, Nullable1, String)
I’m getting the same error here, at initialization.
I think it’s due to some Nakama dll dependency, I’ve never encounter this problem with Unity before
We are using Nakama 2.8.0, Unity 2019.2.10f1, and Unity Nakama Client SDK 2.3.2
Ok I have two ideas that could resolve the issue but I will need your help to try them @danim. I’ll share two different builds of the client sdk for you to try. Will you have time to help with it?
NOTE: You should rename the file extension to ".unitypackage". I’ve renamed it because the forum does not understand non-standard file extensions and rejects the upload.
I’ve tested it on Android and it’s still happening sorry.
Now the message Plugins: Couldn't open advapi32, error: dlopen failed: library "advapi32" not found is printed twice.
Ok. Thanks @danim. I’ll prepare another build for you to use. This one will work although I believe that the problem lies with how Unity have changed what .NET libraries are made available as part of their standard distribution.
Still happening, sorry.
It happens the first time I call ConnectAsync(m_session, true);. If I don’t open any socket, the error is gone.
I can continue playing, but that warning it’s just weird.
I know what has happened and will explain in detail so it helps us resolve the issue faster next time.
It appears that in Unity 2019.2 and above Unity have changed the default .NET profile. A .NET profile describes to the Roslyn compiler toolchain what collection of DLLs are available from the standard library. I don’t know whether this change was intended by them or a bug in the latest release of the game engine. It’s unclear from their release notes or online resources why they’ve made this change.
The result of it is that the System.Diagnostics.Tracing namespace is no longer available in the .NET profile which Unity uses. This affects how we trace the low level details in the socket libraries we use. The only solution I’ve found which resolves the issue fully so far is to strip out usages of that namespace. I’ll have to dig further in the new year to understand whether the change that Unity has made was intentional.