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

DllNotFoundException: libuv #31

Closed
Radivarig opened this issue Oct 1, 2020 · 20 comments
Closed

DllNotFoundException: libuv #31

Radivarig opened this issue Oct 1, 2020 · 20 comments

Comments

@Radivarig
Copy link

On fresh project and import of DOTSNET 1.18 and Unity 2020.1.2, 2020.1.4, 2020.1.6 versions this error is thrown when trying to run the benchmark scene:

DllNotFoundException: libuv
libuv2k.Native.NativeMethods..cctor () (at Assets/DOTSNET/Scripts/ECS/Transport/Transports/libuv/libuv2k/Native/NativeHandles.cs:181)
Rethrow as TypeInitializationException: The type initializer for 'libuv2k.Native.NativeMethods' threw an exception.
libuv2k.Loop..ctor () (at Assets/DOTSNET/Scripts/ECS/Transport/Transports/libuv/libuv2k/Handles/Loop.cs:16)
DOTSNET.Libuv.LibuvTransportServerSystem.Start () (at Assets/DOTSNET/Scripts/ECS/Transport/Transports/libuv/DOTSNET/LibuvTransportServerSystem.cs:61)
DOTSNET.NetworkServerSystem.StartServer () (at Assets/DOTSNET/Scripts/ECS/NetworkServer/NetworkServerSystem.cs:113)
DOTSNET.NetworkServerAuthoring.StartServer () (at Assets/DOTSNET/Scripts/Authoring/NetworkServerAuthoring.cs:42)
DOTSNET.NetworkServerHUD.OnGUI () (at Assets/DOTSNET/Scripts/Authoring/NetworkServerHUD.cs:21)

When I select the dll and press Plugin load settings > Load on startup > Apply this is thrown:

Plugins: Failed to load 'Assets/DOTSNET/Scripts/ECS/Transport/Transports/libuv/libuv_binaries/windows/libuv.dll' because one or more of its dependencies could not be loaded.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I tried deleting the dll and reimporting it as one user on the discord suggested but the problem persists.

@Radivarig
Copy link
Author

Happens for both architectures x86 and x86_64

@shredder2500
Copy link

Also having this issue

@Radivarig
Copy link
Author

Radivarig commented Oct 1, 2020

I've installed Dependencies. When I run dependenciesgui and select the libuv.dll it says these are missing:

  • WS2_32.dll
    • ext-ms-win-shell32-shellcom-l1-1-0.dll
    • ext-ms-win-shell32-shellfolders-l1-1-0.dll
  • VCRUNTIME140D.dll
  • ucrtbased.dll

I've installed vc_redist.x64.exe from https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads and restarted but still the same.

@Radivarig
Copy link
Author

Radivarig commented Oct 1, 2020

So.. I've installed Visual Studio Community edition and about 10gb of stuff through the Visual Studio Installer:

  • .NET desktop development
  • Desktop development with C++
  • Game development with Unity

(Not sure if all three were necessary but that is what I ticked)

And after the restart it solved these dll errors...

@miwarnec miwarnec reopened this Oct 2, 2020
@miwarnec
Copy link
Owner

miwarnec commented Oct 2, 2020

hey guys. having to install dependencies sucks.
this is supposed to work out of the box, will take a look.

@miwarnec
Copy link
Owner

miwarnec commented Oct 2, 2020

@Radivarig which windows version exactly?

@shredder2500
Copy link

I had the same issue, got it working on my machine with installing the below options. not sure what ones did the trick but the three listed above did not do it alone for me. Also below is my OS info. Same issue on Playfab server. mcr.microsoft.com/playfab/multiplayer:wsc-10.0.17134.950

Edition: Windows 10 Pro Insider Preview
Version: 2004
OS Build: 20221.1000

  • .Net Core cross-platform development
  • Game Development with C++
  • Game development with Unity
  • Desktop development with C++
  • .NET desktop Development
  • Node.js development
  • ASP.NET and web development

@Radivarig
Copy link
Author

@vis2k Windows Home 10.0.19041

@Aeonwalker
Copy link

Aeonwalker commented Oct 3, 2020

@vis2k I installed the dependencies that Radivarig suggested. However, I don't think those are necessary, but I could be wrong as I haven't tested it. I did get the issue to go away though after completely uninstalling Visual Studio that unity provided and then using the visual studio community installer to setup Visual Studio fixed the issue. I selected the 3 (.NET desktop development, Desktop development with C++, Game development with Unity) that Radivarig suggested.

I believe the main issue for why this issue pops up is because "ucrtbased.dll" was not found in my windows directory. Installing the dependencies did not fix it. Doing what I mentioned above properly installed the missing "ucrtbased.dll" into my windows directory as it didn't exist before doing what I did above.

EDIT I don't have DOTSNET. This was for the 2.21 version of UMMORPG CE which I would imagine both are using the same libuv files.

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

thanks for feedback guys.
currently setting up a fresh windows 10 to try and reproduce it.

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

alright, managed to reproduce it in a fresh W10 install:
2020-10-03_10-53-36

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

including the libuv.lib file found in windows build folder does not work.
I opened a ticket at libuv repo, perhaps they have answers: libuv/help#174

@Aeonwalker how did you find out that ucrtbased.dll is missing? Do you know if any others are missing? We can try to include them in the Unity folder, maybe that fixes it.

@Radivarig
Copy link
Author

@Aeonwalker the program "Dependencies" is a tool that you have to open libuv.dll with in order to see what dependencies of the selected DLL are not found on your system, then you can start obtaining each of the missing ones. For me it was the three I've listed, for others it might be something else as well.

@Aeonwalker
Copy link

Aeonwalker commented Oct 3, 2020

@vis2k I used the dependencies tool that @Radivarig posted. If you download the tool and run the program "dependenciesgui", you can load the "libuv.dll" file that came with DOTSNET/UMMORPG CE. It'll spit out the dependencies and tell you if something is missing. For me, "ucrtbased.dll" was missing while I had the other ones that @Radivarig was missing. I also recently wiped all files on my laptop and did a fresh install of windows 10 pro (version 2004, os build 19041.508).

I did some googling and found out from a forum where people trying to use libuv also had a similar issue with this "ucrtbased.dll" file missing. They would have the "ucrtbase.dll" file existing in the windows system directory, but the "ucrtbased.dll" wasn't there.

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

thanks for sharing the tool @Radivarig . checking :)

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

again, thanks for sharing the Dependencies tool :)
turns out we need vcruntime140d.dll and ucrtbased.dll for libuv.dll to run.

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

some more research: https://stackoverflow.com/questions/39010509/vcruntime140-dll-vs-vcruntime140d-dll

vcruntime140.dll is present by default.
vcruntime140d.dll is the debug version, which is not present.

ucrtbase.dll is present by default.
ucrtbased.dll is the debug version, which is not present.

the solution is to either ship the 'd' versions along libuv.dll, or find out how to build it as release.

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

testing release build now

@miwarnec
Copy link
Owner

miwarnec commented Oct 3, 2020

works perfectly:
2020-10-03_12-39-26

thanks everyone for help. will deploy it to DOTSNET again. hopefully the release build isn't detected as virus anymore either :)

@miwarnec miwarnec closed this as completed Oct 3, 2020
@Radivarig
Copy link
Author

Great!

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

4 participants