Search Unity

Unity 2018.2 for Oculus Go: " DllNotFoundException: Unable to load DLL 'OVRPlugin'

Discussion in 'AR/VR (XR) Discussion' started by AquaGhost, Jul 24, 2018.

  1. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    When we import our project into 2018.2, we get these errors and the oculus has disabled VR.

    I did a logcat and found the errors below. I know that unity has its own built-in OVRPlugin, so it seems to be a conflict. We tried a build with the most up to date oculus utiliies installed. And we also tried one where we only installed the scripts that we needed from the oculus utilies, and relied on the unity DLL that is included. Same result.
    Downgraded to 2018.1 and it works.

    Is this a known issue or is there some migration process that I'm missing for 2018.2?
    As you can see below, it shows the plugin version as 0.0.0. This same error happens if we use the included .26 version.

    Here's the log:
    Unity v2018.2.0f2, Oculus Utilities v1.27.0, OVRPlugin v0.0.0, SDK v0.0.0.
    07-23 19:09:59.542 2393 2408 I Unity : OVRManager:Awake()
    07-23 19:09:59.542 2393 2408 I Unity :
    07-23 19:09:59.542 2393 2408 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    07-23 19:09:59.542 2393 2408 I Unity :
    07-23 19:09:59.551 2393 2408 E Unity : DllNotFoundException: Unable to load DLL 'OVRPlugin': The specified module could not be found.
    07-23 19:09:59.551 2393 2408 E Unity : at OVRPlugin+OVRP_1_1_0.ovrp_GetInitialized () [0x00000] in <filename unknown>:0
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hmm, I'm developing for Go on 2018.2, and it's working here. My logcat shows:

    This is using the Oculus Utilities downloaded directly from Oculus.

    I'm not sure why it's not working for you. I'd say, try a fresh project — no plugins at all — see if that works. Then add the Oculus Utilities package, and try that. It worked for me; if it works for you, then maybe you can compare that to what's in your real project, and find the crucial difference.

    Also possibly relevant: I'm using the Mono backend, and the Gradle build system. You could check those.

    HTH,
    - Joe
     
    Ryiah likes this.
  3. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    311
    The error you are seeing appears to be inside of the Oculus script, but the failure is actually somewhere on the Unity side because the script is just using [DllImport] to import the GetInitialized function and that import is actually just passing the reference to the function in the plugin that Unity has loaded into mono.

    Given that the error is "DllNotFoundException" that means that mono was unable to load it either because it doesn't exist (highly unlikely as it ships with the Editor install), or that the project's meta information for where the plugin existed was incorrect and thus mono tried to load the plugin from the wrong location.

    This likely happened because the Oculus Utilities also include a version of the OVRPlugin with them and that one can be used in place of the one shipped with the Editor if it is imported. If you ever removed that plugin without doing so directly from Unity, the metadata would still exist and Unity would assume the plugin to load was the one from the Utilities. If this is the case, it's a bug in that the metadata should have been removed for the removed plugin, but it somehow wasn't. You would likely be able resolve this by either creating a new project, or by deleting the library folder of the project and reloading. As that would reset the metadata.
     
    AquaGhost likes this.
  4. Kyodan

    Kyodan

    Joined:
    Feb 5, 2015
    Posts:
    8
  5. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    @Ed-unity Thanks thats what i guessed but I wasnt sure why it would be holding onto the settings. After a reimport, it seems like the issue is that they changed the path on the Oculus side, too.
    If anyone reads this, the safest way to upgrade from .24 oculus to .26 is to do this:
    Close unity, delete OVR and all metas for it. Open unity, install .26 manually from a download. Then let it do the .27 upgrade via the prompt if it asks. I didnt do all that on the first try and it got into a really bad state.
     
    Kyodan likes this.
  6. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    To me these errors (eg. DllNotFoundException) started to appear when I re-opened a project (public in Oculus Store) that I haven't modified in the past 6 months, neither did I upgrade my Unity version in the past 6 months.

    The only thing I recall having changed recently that may somehow explain why these errors appear in an otherwise unchanged project is that I once downloaded the Visual Studio for Unity (I don't remember if I re-installed Unity itself but I definitely didn't change the version for it). I then switched my Unity settings to use Visual Studio as default code editor, then switched back to MonoDevelop later (as VS didn't work flawlessly with this Unity version). So maybe these changes somehow changed the reference that @Ed-unity mentioned.

    Unfortunately deleting and re-creating the Library folder (which is equivalent of re-importing the entire project as a I recall) would take one or two days for my Macbook's (the Library is about 7 Gb) so I won't be able to do that anytime soon (this project is not currently a priority and I'm using my Mac for other projects so I can't afford not to be able to use it for that long).