Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jlink's avatar
jlink
Explorer
11 years ago

DllNotFoundException, Kinect v2 conflicting with Rift plugin

I am trying to integrate the Kinect v2 plugin for use with the Rift in Unity but I'm running into some weird DLL import issues. Here is the issue as best that I can narrow it down: after importing both the Rift and Kinect v2 plugins THEN closing Unity, when trying to open and run Unity in a scene using the Rift a DllNotFoundException occurs for the Rift.

What is interesting is that before closing Unity, both plugins work fine together. It's only after closing Unity that the DllNotFoundException occurs. Of course the .dll it's looking for is there, yet an error is still returned as if it weren't. Another interesting point is that completely removing the Rift plugin then reimporting does not solve the issue. Also removing the Kinect plugin and leaving the Rift plugin does not solve the issue. The only way I have found to get the Rift plugin working correctly with the Kinect v2 plugin also in the project is to:

1) remove both the Rift and Kinect v2 plugins and associated files from the project
2) close Unity
3) reimport the Rift plugin
4) reimport the Kinect v2 plugin


Is anyone else working with both the Kinect v2 and Rift plugins or does anyone have any ideas for solutions?

6 Replies

Replies have been turned off for this discussion
  • To deal with cross-platform support and backwards compatibility, Unity's "Plugins" folder supports a couple of different (and mutually-exclusive) layouts. It's possible that the Kinect plugin is using a different layout from the Oculus plugin and hiding it. The two plugins should be compatible once they are all in the right folders. After you import both plugins, can you confirm the following structure?

    Assets/
    Plugins/
    <NO PLUGIN DLLS AT THIS LEVEL - SUBFOLDERS ONLY>
    i386/
    OculusPlugin.dll (32-bit)
    <Kinect Plugin DLLs> (32-bit)
    x86_64/
    OculusPlugin.dll (64-bit)
    <Kinect Plugin DLLs> (64-bit)

    If you aren't sure whether a DLL is 32- or 64-bit, you can use the Dependency Walker tool to verify. It will also tell you if the DLL is missing any of its dependencies. Here is the tool: http://www.dependencywalker.com/.
  • That fixed it. I wasn't aware of different plugin folder layouts. Also I'm not sure if this was a mistake, but the 32 bit folder should be named x86, not i386 (tried that, didn't work).

    Thanks for the help.
  • For me the 32-bit OculusPlugin was in the root of the Plugins folder. I moved it to the 'x86' folder and it started working again. FYI, when I renamed 'x86' to 'i386' it didn't work.
  • azimuth's avatar
    azimuth
    Honored Guest
    "raeldor" wrote:
    For me the 32-bit OculusPlugin was in the root of the Plugins folder. I moved it to the 'x86' folder and it started working again. FYI, when I renamed 'x86' to 'i386' it didn't work.

    oh my gad, these two about putting the oculus plugin from the plugins folder into the x86 folder finally helped! I had copied from the x86_64 not thinking there was a difference and this took forever
  • Thanks. I was having problems too. Moving the Oculus dll into the x86 folder fixed it.