cancel
Showing results for 
Search instead for 
Did you mean: 

Error when loading in Oculus Utilities for Unity

Zucchini_Fred
Explorer
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!
33 REPLIES 33

luks0r
Explorer
Yeah! From the line number it looks like you only wrapped one of the three places you have to do this. You need to fix this code in 3 total places, in the morning exact same manner, at these line pairs:

2876 / 2890,
2901 / 2917,
2928 / 2936

See my previous posts for an example of it if you need a refresher.

for easy copy / paste, the wrapping is this:
#if !OVRPLUGIN_UNSUPPORTED_PLATFORM

and

#endif

garyhaus
Honored Guest
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.

JoeS2018
Protege
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.

JoeS2018
Protege
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.

Anonymous
Not applicable
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


garyhaus
Honored Guest
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

aquaSun123
Honored Guest
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
Expert Protege


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.

Omita
Honored Guest
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

lerabot
Honored Guest
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.