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

System.DllNotFoundException: Unable to load shared library 'discord_game_sdk' or one of its dependencies. #23

Closed
NahmiiVuhuni opened this issue Dec 17, 2020 · 5 comments

Comments

@NahmiiVuhuni
Copy link

If I download the Linux (Ubuntu) version, chmod 777 RichPresenceApi, and run it, I get:

$ ./RichPresenceApi
Created DiscordManager c145873a-2a91-4496-9a04-a9713342534d
c145873a-2a91-4496-9a04-a9713342534d - Creating new Discord instance
Unhandled exception. System.TypeInitializationException: The type initializer for 'RichPresenceApi.DiscordManager' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'discord_game_sdk' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdiscord_game_sdk: cannot open shared object file: No such file or directory
   at DiscordSdk.Discord.DiscordCreate(UInt32 version, FFICreateParams& createParams, IntPtr& manager)
   at DiscordSdk.Discord..ctor(Int64 clientId, UInt64 flags) in D:\Programming\Git\FoundryVTT-Discord-Rich-Presence\LocalApi\DiscordSdk\Core.cs:line 1060
   at RichPresenceApi.DiscordManager.CreateDiscord() in D:\Programming\Git\FoundryVTT-Discord-Rich-Presence\LocalApi\RichPresenceApi\DiscordManager.cs:line 44
   at RichPresenceApi.DiscordManager..cctor() in D:\Programming\Git\FoundryVTT-Discord-Rich-Presence\LocalApi\RichPresenceApi\DiscordManager.cs:line 31
   --- End of inner exception stack trace ---
   at RichPresenceApi.DiscordManager.CreateDiscord() in D:\Programming\Git\FoundryVTT-Discord-Rich-Presence\LocalApi\RichPresenceApi\DiscordManager.cs:line 39
   at TestApi.Program.CreateHostBuilder(String[] args) in D:\Programming\Git\FoundryVTT-Discord-Rich-Presence\LocalApi\RichPresenceApi\Program.cs:line 59
   at TestApi.Program.Main(String[] args) in D:\Programming\Git\FoundryVTT-Discord-Rich-Presence\LocalApi\RichPresenceApi\Program.cs:line 21
[1]    2099706 IOT instruction (core dumped)  ./RichPresenceApi

If I download the source for 2.1.0, go to LocalApi/RichPresenceApi, and run dotnet run, I get:

$ dotnet run
MessageHandlers/VoiceOptionsMessageHandler.cs(12,39): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/RichPresenceApi.csproj]
MessageHandlers/GameStatusMessageHandler.cs(12,39): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/RichPresenceApi.csproj]
MessageHandlers/ModuleLaunchedMessageHandler.cs(16,39): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/RichPresenceApi.csproj]
MessageHandlers/VoiceLobbyMessageHandler.cs(24,28): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/RichPresenceApi.csproj]
MessageHandlers/VoiceLobbyMessageHandler.cs(99,28): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/RichPresenceApi.csproj]
Created DiscordManager e6f662fd-c49b-4439-840c-2e25c9a4b149
e6f662fd-c49b-4439-840c-2e25c9a4b149 - Creating new Discord instance
Unhandled exception. System.TypeInitializationException: The type initializer for 'RichPresenceApi.DiscordManager' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'discord_game_sdk' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdiscord_game_sdk: cannot open shared object file: No such file or directory
   at DiscordSdk.Discord.DiscordCreate(UInt32 version, FFICreateParams& createParams, IntPtr& manager)
   at DiscordSdk.Discord..ctor(Int64 clientId, UInt64 flags) in /home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/DiscordSdk/Core.cs:line 1060
   at RichPresenceApi.DiscordManager.CreateDiscord() in /home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/DiscordManager.cs:line 44
   at RichPresenceApi.DiscordManager..cctor() in /home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/DiscordManager.cs:line 29
   --- End of inner exception stack trace ---
   at RichPresenceApi.DiscordManager.CreateDiscord() in /home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/DiscordManager.cs:line 38
   at TestApi.Program.CreateHostBuilder(String[] args) in /home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/Program.cs:line 57
   at TestApi.Program.Main(String[] args) in /home/hubok/Downloads/FoundryVTT-Discord-Rich-Presence-2.1.0/LocalApi/RichPresenceApi/Program.cs:line 21

Version info:

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.110
 Commit:    f02c158773

Runtime Environment:
 OS Name:     fedora
 OS Version:  33
 OS Platform: Linux
 RID:         fedora.33-x64
 Base Path:   /usr/lib64/dotnet/sdk/3.1.110/

Host (useful for support):
  Version: 3.1.10
  Commit:  1721e39439

.NET Core SDKs installed:
  3.1.110 [/usr/lib64/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.10 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.10 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
@cswendrowski
Copy link
Owner

cswendrowski commented Feb 25, 2021

Please reopen if this is still occurring with the latest build

@NahmiiVuhuni
Copy link
Author

Please reopen if this is still occurring with the latest build

There have been no commits since I posted this issue, so I'm confused how this could've changed?

@cswendrowski
Copy link
Owner

Please reopen if this is still occurring with the latest build

There have been no commits since I posted this issue, so I'm confused how this could've changed?

The builds for the companion API are done locally, with me manually copying in the correct Discord .dll per target, then uploading the result to the Releases. A previous build had the incorrect .dll, something that should now be resolved

@NahmiiVuhuni
Copy link
Author

NahmiiVuhuni commented Mar 8, 2021

I would be happy to test it, but there have been no new commits to try it on.

I'm trying on v2.1.0, using both the Linux and any OS method. Should I try against any specific version of .NET?

@mastef
Copy link

mastef commented Jul 23, 2021

Try renaming discord_game_sdk.so to libdiscord_game_sdk.so

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

3 participants