Skip to main content
Up and Coming
February 9, 2014

DllNotFoundException: OculusPlugin

I seem to have an issue adding the plugin portion to an existing project. No matter how many times I import the OculusUnityIntegration package, it still comes up with these types of errors:

DllNotFoundException: OculusPlugin
OVRDevice.Awake () (at Assets/OVR/Scripts/OVRDevice.cs:218)

I can see the right oculus files (ie OculusPlugin.DLL) files in the plugin folder of the project but still errors. If I try to reinstall the Unity Integration package the plugin folder always shows up as "new" which leads me to believe there is something up with some marker/pointer or the folder structure.

I can create new projects fine however, but would like to add integration to existing projects. Thanks in advance, I'm still fairly new to Unity (3 Months.)
    This topic has been closed for replies.

    19 replies

    rootedAuthor
    Up and Coming
    February 10, 2014
    After digging around I found a solution to the problem. I had to add the "OculusPlugin.DLL" to the Unity "editor" folder. Strange but it works!

    I found the solution in an unrelated thread located here: http://forum.unity3d.com/threads/31083-DllNotFoundException-when-depend-on-another-dll
    Inspiring
    February 11, 2014
    Interesting finding. I hadn't seen this one before. Thanks for following up.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Participant
    March 14, 2014
    After digging around I found a solution to the problem. I had to add the "OculusPlugin.DLL" to the Unity "editor" folder. Strange but it works!


    I'm afraid I now have this problem too, but can't resolve it with your fix.

    I've been making a Rift game from scratch, has been working fine up until this point. The thing that (probably?) caused it, was that I turned all my Rift OVR/camera stuff off and was using normal cameras for a while. When I switched back, its all broken. Hoping its just something I've foolishly forgotten to change back, but I've been at it for a while now and no good.

    Here's the errors I'm getting:

    DllNotFoundException: OculusPlugin
    OVRDevice.OnDestroy () (at Assets/OVR/Scripts/OVRDevice.cs:328)

    DllNotFoundException: OculusPlugin
    OVRDevice.GetLatencyResultsString () (at Assets/OVR/Scripts/OVRDevice.cs:568)
    OVRCamera.LatencyTest (UnityEngine.RenderTexture dest) (at Assets/OVR/Scripts/OVRCamera.cs:301)
    OVRCamera.OnRenderImage (UnityEngine.RenderTexture source, UnityEngine.RenderTexture destination) (at Assets/OVR/Scripts/OVRCamera.cs:206)

    DllNotFoundException: OculusPlugin
    OVRDevice.Awake () (at Assets/OVR/Scripts/OVRDevice.cs:218)

    etc!

    *edit I also changed from deferred to forward and back again...

    Anyone have any ideas?

    Thanks,
    Jay
    Up and Coming
    April 17, 2014
    "JayExbleative" wrote:
    After digging around I found a solution to the problem. I had to add the "OculusPlugin.DLL" to the Unity "editor" folder. Strange but it works!


    I'm afraid I now have this problem too, but can't resolve it with your fix.

    I've been making a Rift game from scratch, has been working fine up until this point. The thing that (probably?) caused it, was that I turned all my Rift OVR/camera stuff off and was using normal cameras for a while. When I switched back, its all broken. Hoping its just something I've foolishly forgotten to change back, but I've been at it for a while now and no good.

    Here's the errors I'm getting:

    DllNotFoundException: OculusPlugin
    OVRDevice.OnDestroy () (at Assets/OVR/Scripts/OVRDevice.cs:328)

    DllNotFoundException: OculusPlugin
    OVRDevice.GetLatencyResultsString () (at Assets/OVR/Scripts/OVRDevice.cs:568)
    OVRCamera.LatencyTest (UnityEngine.RenderTexture dest) (at Assets/OVR/Scripts/OVRCamera.cs:301)
    OVRCamera.OnRenderImage (UnityEngine.RenderTexture source, UnityEngine.RenderTexture destination) (at Assets/OVR/Scripts/OVRCamera.cs:206)

    DllNotFoundException: OculusPlugin
    OVRDevice.Awake () (at Assets/OVR/Scripts/OVRDevice.cs:218)

    etc!

    *edit I also changed from deferred to forward and back again...

    Anyone have any ideas?

    Thanks,
    Jay


    I'm having this issue on my Mac. Its driving me batty
    Up and Coming
    April 18, 2014
    I had this problem earlier this week and here was the cause in my case.

    I installed an unrelated 3rd part Unity Asset which had both 32 bit and 64 bit dlls. The package created two folders in my project's /plugins folder called 'x86' and 'x86_64', for the 32 bit and 64 bit files, respectively. Here's where the problem started. When Unity detects a folder called 'x86' in /plugins, it will look only in that folder for 32 bit plugins, ignoring any existing .dlls in /plugins. The solution was to move the files from /plugins/x86 into /plugins and to deleted the empty 'x86' folder. Once I did this, the DllNotFoundException went away.
    Up and Coming
    April 20, 2014
    The thing that worked for me was to move Plugins/OculusPlugin.dll into Plugins/x86/OculusPlugin.dll.
    April 22, 2014
    I'm getting the same error with Unity 4.3.4f1, and ovr_unity_0.3.1_lib, on OSX 10.9.2.

    Moving the plugin does not work.
    April 22, 2014
    Just to add to this, it DOES work ok with ovr_unity_0.2.5c_lib!


    The Tuscany package also has the same errors in ovr_unity_0.3.1_lib


    I see the the SDK is missing the .bundle for it to work on OSX?
    http://docs.unity3d.com/Documentation/Manual/PluginsForDesktop.html
    Inspiring
    April 22, 2014
    @yezzer: Can you be specific as to the exact error you are getting? This topic is about a DLL not being found, and I don't believe OSX uses DLLs (that's a Windows thing).
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    April 23, 2014
    "cybereality" wrote:
    @yezzer: Can you be specific as to the exact error you are getting? This topic is about a DLL not being found, and I don't believe OSX uses DLLs (that's a Windows thing).


    Yes, OSX does not use DLLs, it uses .bundles, which OculusUnityIntegration.unitypackage in ovr_unity_0.3.1_lib does not contain. Your previous releases (eg: ovr_unity_0.2.5c_lib) did contain a .bundle for Oculus to work in Unity on OSX (Assets/Plugins/OculusPlugin.bundle).

    At least, I believe that's the problem. However, Unity uses Mono, which does use DLLs, so that might not be the issue.

    There are some very simple steps to reproduce this. You need the latest version of Unity on OSX:

      - Create new project in Unity 4.3.4f1 on OSX
      - Import OculusUnityIntegration.unitypackage in ovr_unity_0.3.1_lib
      - Add OVRCameraController to the scene
      - Hit play


    Console output:

    DllNotFoundException: OculusPlugin
    OVRDevice.Awake () (at Assets/OVR/Scripts/OVRDevice.cs:153)

    DllNotFoundException: OculusPlugin
    OVRDistortionMesh.GetIdealFOV () (at Assets/OVR/Scripts/OVRDistortionMesh.cs:101)
    OVRCamera.GetIdealVFOV () (at Assets/OVR/Scripts/OVRCamera.cs:318)
    OVRCameraController.InitCameraControllerVariables () (at Assets/OVR/Scripts/OVRCameraController.cs:195)
    OVRMainMenu.Start () (at Assets/OVR/Scripts/OVRMainMenu.cs:218)

    DllNotFoundException: OculusPlugin
    OVRDistortionMesh.GetIdealFOV () (at Assets/OVR/Scripts/OVRDistortionMesh.cs:101)
    OVRCamera.GetIdealVFOV () (at Assets/OVR/Scripts/OVRCamera.cs:318)
    OVRCameraController.InitCameraControllerVariables () (at Assets/OVR/Scripts/OVRCameraController.cs:195)
    OVRCameraController.Start () (at Assets/OVR/Scripts/OVRCameraController.cs:164)

    DllNotFoundException: OculusPlugin
    OVRDistortionMesh.GetIdealResolution (System.Int32& w, System.Int32& h) (at Assets/OVR/Scripts/OVRDistortionMesh.cs:109)
    OVRCamera.GetIdealResolution (System.Int32& w, System.Int32& h) (at Assets/OVR/Scripts/OVRCamera.cs:337)
    OVRCamera.Start () (at Assets/OVR/Scripts/OVRCamera.cs:106)

    etc, etc..


    Feel free to contact me directly if that would help. I've DM'd you my email address.