Search Unity

why is my Discord (plugin) DLL not found?

Discussion in 'Editor & General Support' started by JoeStrout, Jan 24, 2021.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm trying to use the Discord Unity plug-in to register when players are playing my game. But I'm getting a DllNotFoundException when my built Mac game launches, and I don't understand why.

    The plugin comes with a variety of lib files:

    upload_2021-1-24_7-38-54.png

    I have the import settings on these configured as follows:
    • discord_game_sdk.bundle: include on Editor, Standalone, WebGL; Platform Mac OS X x64 checked.
    • discord_game_sdk.dll: include on Any Platform, excluding WebGL; Windows x86 and x86_x64 checked.
    • discord_game_sdk.dll: Unity presents no import options (no inspector at all) for this file.
    • discord_game_sdk.dylib: include Standalone and WebGL, Mac OS X x86 checked.
    • discord_game_sdk.so: include Any Platform, Linux and Mac x86 both checked.
    I've also tried both with and without "Load on startup" checked for the files that offer that.

    But the result is always an error logged as:

    which is interesting because the built app bundle doesn't even have a MonoEmbedRuntime folder. The folder structure looks like this:

    upload_2021-1-24_7-43-54.png

    As you can see the plugin files landed in a Plugins/x86_64 folder, and the Frameworks folder has no MonoEmbedRuntime folder. I've tried manually creating the folder structure in the log messages (hacking the app bundle after it is built), but it still doesn't work (same error log).

    I'm stumped. What's especially frustrating here is that this used to work — in fact my discord status right now still reflects the app name/message set by my app months ago. But at some point, I must have poked something because now I'm getting this exception. And no combination of checkboxes seems to get my back to a working state.

    Any idea what I'm doing wrong here?
     
  2. indie6

    indie6

    Joined:
    Dec 15, 2012
    Posts:
    101
    @JoeStrout were you able to fix the issue? I am using another plugin, but suddenly getting DLL not found exception, even though the bundle file can be found in the Plugins folder
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I had it working for a while, but it turned out to be way more trouble than it's worth. On some (usually Windows) machines, it would cause the app to actually fail to launch (or maybe, to crash during launch) if Discord was not installed or not running.

    I can't have that. So just this week I deleted the Discord plugin from my project. It just ain't worth it.
     
    Joe-Censored likes this.