Skip to main content
New Participant
June 21, 2018

Error when loading in Oculus Utilities for Unity

Hi,

When I load in the Oculus Utilities for Unity, I immediately have an error in one of the scripts which reads "Assets/Oculus/VR/Scripts/OVRPlugin.cs(2876,18): error CS0103: The name `OVRP_1_15_0' does not exist in the current context"
How can I deal with this error? Is there a way to locate OVRP or is that no longer a part of the oculus utilities?
Thank You!
This topic has been closed for replies.

33 replies

New Participant
July 24, 2018
I could really use the help...  I am so very new to the Oculus Go and not a programmer, and I am on a Mac, no choice for dev work... I am not following what you posted as my line numbers are not the same with what you stated.
Up and Coming
July 24, 2018
For what it's worth, I too am developing for Go on my Mac — I'm supporting Oculus even though they don't support me.

Luks0r's fix does the trick on my machine.
Up and Coming
July 24, 2018
For what it's worth, I too am developing for Go on my Mac — I'm supporting Oculus even though they don't support me.

Luks0r's fix does the trick on my machine.
July 25, 2018
For those Mac users, it's easiest to mark macOS as a supported platform rather than fix each instance of the undefined constant.

Line 22 of OVRPlugin.cs lists out the criteria to meet to get the "unsupported' flag (OVRPLUGIN_UNSUPPORTED_PLATFORM) which in turn triggers the error that brought everyone to this page.

Mark macOS as a valid platform by adding UNITY_EDITOR_OSX to the list of platform checks on line 22:
#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || (UNITY_ANDROID && !UNITY_EDITOR))

Alternatively, you can just comment out line 23 to stop the flag from ever getting set:
//#define OVRPLUGIN_UNSUPPORTED_PLATFORM


New Participant
July 25, 2018
YAYE!  Thank you all so much.  What a birthday gift.  Error is now gone.  I used #if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || (UNITY_ANDROID && !UNITY_EDITOR)) on line 22

Participant
July 31, 2018
The brandoncash fix works great. I assumed that osx would still be supported, as in, using Unity on a Mac to make Oculus Go apps. Hopefully that makes sense to support.
Corysia
Up and Coming
August 1, 2018


For those Mac users, it's easiest to mark macOS as a supported platform rather than fix each instance of the undefined constant.

Line 22 of OVRPlugin.cs lists out the criteria to meet to get the "unsupported' flag (OVRPLUGIN_UNSUPPORTED_PLATFORM) which in turn triggers the error that brought everyone to this page.

Mark macOS as a valid platform by adding UNITY_EDITOR_OSX to the list of platform checks on line 22:
#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || (UNITY_ANDROID && !UNITY_EDITOR))

Alternatively, you can just comment out line 23 to stop the flag from ever getting set:
//#define OVRPLUGIN_UNSUPPORTED_PLATFORM




Thanks for tracking that down, brandoncash!

Alternatively, you can remove or comment out all three lines:
//#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || (UNITY_ANDROID && !UNITY_EDITOR))
//#define OVRPLUGIN_UNSUPPORTED_PLATFORM
//#endif
I know OSX isn't supported, but like aquaSun123, I develop on OSX sometimes with a target platform of Win64 or Daydream.  Cross compiling shouldn't be stopped by this, but that's the result.  I'm assuming this is a recent change because an older version of the Oculus Utilities didn't give me this grief.
VR Development: https://discord.gg/8R9SHQP Quest Example: https://github.com/Corysia/Unity-Oculus-Example
New Participant
August 3, 2018
If people are still stuck, just use 'Oculus Utilities 1.26' instead until the 1.27 is fixed.

Otherwise, here is a gist with the 
OVRPlugin.cs fixes that @luks0r suggested:
https://gist.github.com/haysclark/62c105b676ac16cee6cd7b38ef62acd1
New Participant
August 10, 2018
By the way, you can also add UNITY_EDITOR_LINUX and that will make it work on Linux aswell. I'm building stuff for the GO flowlessly.
Oculus GO LINUX dev. ^ a new SEGA Dreamcast game.
New Participant
September 5, 2018
UNITY_EDITOR_OSX works, it takes a while to build tho!  :)
patient... :D