Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Disabling XR for a regular build

Discussion in 'VR' started by MaskedMouse, Aug 27, 2021.

  1. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    I have an application that has targets for both VR and Non-VR.
    Android for Quest and just regular Android.

    Whenever I turn off the Oculus XR in the XR Management and build again, on bootup it'll complain that it failed to load the Oculus XR plugin. This is probably harmless but it feels like I'm building with leftover Oculus XR code.
    Same goes for a regular Windows build, this error pops up in a development build while it has been built without XR turned on nor any of the plugins turned on.

    I can remove the Oculus XR package completely but thats just annoying. I mean what's the XR management for, if you cannot disable it completely for a regular non-vr build? Why are there remnants of XR plugins while you've explicitly disabled it? besides the package still being installed after disabling them. I don't mind packages still being in the project but they aren't disabled completely after toggling them off either.

    Would be nice if all code related to the XR plugins were excluded / stripped when turned off.
     
  2. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    74
    We shouldn't be attempting to initialize the Oculus XR Plugin if you have it disabled in XR Management. What's the specific error you're seeing? Which versions of the Oculus XR Plugin and management packages are you using?

    Can you try to disable Oculus on all platforms within management?
     
  3. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    74
    Try updating to Oculus XR Plugin 1.9.1 or higher and see if that resolves the issue you're seeing.
     
  4. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    I'm using Unity 2021.1.18 with XR Management 4.1.0 and Oculus XR 1.10.0

    After building a development build it instantly pops up with the error message
    Code (CSharp):
    1. Plugins: Failed to load 'OculusXRPlugin' because one or more of its dependencies could not be loaded.
    For Standalone PC (Non XR), XR has been turned off, but for Android it is on (currently).
    Even after turning it off (disabling XR on startup & untoggling Oculus XR from Android) but leaving the Oculus XR package in the project, it still throws that error message.
     
  5. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    74
    Is there any chance you could file a bug and link to it here? I’ve tried to reproduce this behavior, but am not seeing the error message. If you have more complete steps to repro, and ideally a repro project, that would be very helpful.
     
  6. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,091
    I've tried reproducing it in a new project but it doesn't occur there. But if I build the project I am working on, it still outputs the error on startup. So I guess something in my project is keeping the Oculus XR around.

    I'll have to investigate this a bit more

    Edit:
    I am not fully certain what was causing the error log. I downloaded a new copy from git and deleted the Library folder to do a full reïmport. I noticed a login request for our old git server. One of the packages was still referring to the old server. So I changed that.
    Apart from that I deleted the AddressableAssetsData/Android Windows and iOS folders. Rebuilt the addressables.
    I rebuilt the application and it's fixed now. But I am uncertain whether it was because of the old package or due to addressables.

    But since it is fixed, I hope it won't return. If it does I'll make sure to do a bug report.
     
    Last edited: Oct 7, 2021