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
System.DllNotFoundException caused by dynamically linked CRT #1440
Comments
Hey, sorry to see you run into issues. |
90% are from Windows 10.0.19045 It seems to be a mix of machines and, various languages. Some devices that appear: The issue here is that sentry is trying to reference dlls that don't exist on those systems, since sentry is linking to a specific version of the libraries. I believe the fix is simple: statically link to the libraries, instead of dynamically link. |
Just to add to this, it looks like you have a dependency on the native sentry library, and the docs there have the following:
So the built sentry dll that you're relying on, has been built as a shared library. You'll want to build it with SENTRY_BUILD_SHARED_LIBS set to OFF so that it's built as a static library instead. I think that will solve it, but I could be wrong |
Hey, thanks for providing all the extra context. |
@bitsandfoxes Sorry for the slow reply, it seems my github notifications haven't been working, should be fixed now. This is using the Unity sentry library (This github). The callstack appears to be:
The Unity log reveals only that it was called immediately after the app loads: |
Thanks for the details, @CliffCawley - we'll have a look at this by the end of this week. |
I think that's a fair request. Especially on desktop platforms the increase in size should be alright? |
Thanks @bitsandfoxes, that would be great! |
Environment
How do you use Sentry?
sentry.io through Unity
Which version of the SDK?
1.5.1
How did you install the package? (Git-URL, Assetstore)
Unity Package Manager
Which version of Unity?
2022.3.8f1
Is this happening in Unity (editor) or on a player like Android, iOS, Windows?
Player, Windows 10 IL2CPP Production build
Steps to Reproduce
Difficult to reproduce, because this is happening in the wild, but the issue seems to be because you're compiling sentry.dll with the dynamic CRT linked in. This means we're required to ensure that the user has the correct CRT runtimes installed too.
Would be great if it was possible to statically link the CRT instead, so that we don't need additional runtimes installed:
Using depends you can see the currently dynamically linked dlls (see below)
On systems that don't have this installed, but run our IL2CPP Unity game just fine, we experience the System.DllNotFoundException
Expected Result
No exception
Actual Result
System.DllNotFoundException
Unable to load DLL 'sentry'. Tried the load the following dynamic libraries: Unable to load dynamic library 'sentry' because of 'Failed to open the requested dynamic library (0x06000000) - The specified module could not be found. (WinError:0000007e)
Any logs or screenshots
The text was updated successfully, but these errors were encountered: