Vatuu / discord-rpc

Java Wrapper of the Discord-RPC Library for Discord Rich Presence.
MIT License
194 stars 42 forks source link

Crashes with java.lang.UnsatisfiedLinkError on Windows #50

Closed Spikatrix closed 1 year ago

Spikatrix commented 3 years ago

Describe the bug On Windows, the build from the recent commit (1f82937) crashes with a java.lang.UnsatisfiedLinkError. I'm using api 'com.github.Vatuu:discord-rpc:1f82937' in gradle. The crash occurs when running a single instance of my game itself.

Using a version before #49 was merged works without any issues. For instance, api 'com.github.Vatuu:discord-rpc:0293d57' works without crashing for a single instance of the game.

Source DiscordRPC.discordInitialize(applicationID, null, false);

Error (Trimmed to exclude uneccessary information)

Exception in thread "Game Application" java.lang.UnsatisfiedLinkError: Unable to load library 'discord-rpc': Native library (win32-x86-64/discord-rpc.dll) not found in resource path ([file:/C:/Users/jas/Downloads/Game.jar])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
        at com.sun.jna.Library$Handler.<init>(Library.java:179)
        at com.sun.jna.Native.loadLibrary(Native.java:569)
        at com.sun.jna.Native.loadLibrary(Native.java:544)
        at net.arikia.dev.drpc.DiscordRPC$DLL.<clinit>(DiscordRPC.java:222)
        at net.arikia.dev.drpc.DiscordRPC.discordInitialize(DiscordRPC.java:32)

Versions (Must be completed):

Additional info This issue happens only on Windows. On Linux, both the recent commit and the older one works without crashing for a single instance.