cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Reality SDK Oculus failed to initialize.

marko_rkm
Honored Guest
Hello, as you have seen in the title I'm having problems to Initialize the Oculus Rift SDK in Unity. I'm working in an app for samsung Gear VR.
the versions I'm using are these:
  • Unity 2017.3.1f1 
  • ovr_unity_utilities_1.24.0
  • OVRPlatformSDK_v1.24.0
  • ovr_avatar_sdk_1.24.0
I'm following the instructions marked in this guide : https://developer.oculus.com/documentation/platform/latest/concepts/pgsg-unity-gsg/

When I put play in my game the following messages appear in my console:
-Virtual Reality SDK Oculus failed to initialize.
Attempting to enable None instead.
-Unity v2017.3.1f1, Oculus Utilities v1.24.0, OVRPlugin v1.24.0, SDK v0.0.0.
UnityEngine.Debug:Log(Object)
OVRManager:Awake() (at Assets/OVR/Scripts/OVRManager.cs:904)

86txdl9huk8g.png

The first one appears as a warning and the second one appears as a message. Also, I've put the 'Gear VR App Id' number in the 'OculusPlatformSettings' and these errors still appearing.

I've made every step from 'Create an App' to 'Configuring Your App for Local Development', but I get stuck in the 'Initialize the SDK and Perform the Entitlement Check' step, basicly that step asked me to create a script for initialize the SDK with my appID but I have no idea how to use it, or if I have to use it.

I created a script like this:

using UnityEngine;
using Oculus.Platform;

public class AppEntitlementCheck: MonoBehaviour {

void Awake ()
{
try
{
Core.AsyncInitialize();
Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback);
}
catch(UnityException e)
{
Debug.LogError("Platform failed to initialize due to exception.");
Debug.LogException(e);
// Immediately quit the application.
UnityEngine.Application.Quit();
}
}

void GetEntitlementCallback (Message msg)
{
if (msg.IsError)
{
Debug.LogError("You are NOT entitled to use this app.");
UnityEngine.Application.Quit();
}
else
{
Debug.Log("You are entitled to use this app.");
}
}
}

Could you explain to me why these error still appearing and if there's a solution?

I'll give thanks to everyone who support me in this topic.

:smile:

44 REPLIES 44

Stubbo1705
Honored Guest
abr5s47r2lf5.jpg

ssedlmayr_nomad
Explorer
@imperativity, my current theory is that the root cause has to do with removing or upgrading the Oculus Utilities package, which our project relies on. Steps to reproduce on my machine are:

1. Create a new project in Unity 2018.1.0b12/0b13.
2. Make sure virtual reality support is enabled and Oculus is in the list
3. Launch your Oculus app
4. Run your Unity project; the app should work fine with full head tracking
5. Import the Oculus utilities package (any version)
6. Run your project; should still work
7. Remove the Oculus utilities or upgrade to a newer version
8. Run the app; this time, the Oculus SDK will fail to initialize on my machine
9. The only way out of this situation is to uninstall and reinstall Unity
10. After doing so, run the app; it will work again

Anonymous
Not applicable
Hi! I was having the same problem after update for the last OVR Unity Utilities (1.24) in Unity 2017.3 versions

So I removed all unity versions of my Pc. Download the Unity Hub and got the 2017.3.1f1 version.
After create a new project and import the OVR Unity Utilities 1.24 (the unitypackage) i saw an error message saying that the Plugins/Android/assets folder was not found. Then i got the same error again trying to run some empty scene with Oculus VR enabled in Player Prefs as the others users here.

So i deleted this project, create a new one and added manually the "Plugins/Assets/assets" folder. This time it imported nicely and everything come back to work! So i think the problem is that the last OVR Unity Utilities (1.24) is broke someway and is not automatically creating the Plugins/Android/assets folder...

Hope it can help someone. At least it worked for me

Anonymous
Not applicable
A reproducible way to make it crash (and one workaround to fix):
I'm using Windows 7 x64 and Unity 2017.3.1f1

Making it Crash:
- Create a new project
- Let it as PC/Windows Build
- Import the Unity Utilities 1.24
- Set the VR SDK to Oculus
- Play it and see it fail

How to Make it Work:
- Create a new project
- Set it to Android Build
- Set the VR SDK to Oculus
- Create the Plugins/Android/assets folder
- Import the Unity Utilities 1.24

I tested those workflows twice before post. I have some suspect that it's something related to the x64 dll when importing with Windows Build as target... that is breaking all the VR Systems in Unity. I have no idea why and since I'm not an expert i could not investigate it more than that. At least this workaround is working for me.

Bye!


markhansaven
Explorer
If you downgrade Unity to 2017.1 it works. It very may well be when the namespace VR was changed to XR that Oculus stopped working out of the box.

I've had this trouble for more than a month now so I'm gonna try your guys workarounds and see if it works...

marko_rkm
Honored Guest


@marko_rkm
@markhansaven

Hi, we were unable to reproduce this behavior in both your sample project provided above, our internal project mirroring your own, and a new project using Unity 2017.4.0f1.

However, we were finally able to reproduce this behavior by stopping all services associated with the oculus runtime. Do you have the runtime installed on either of your machines you are building on? If so, are the services actively running in the background? The Oculus runtime is required for testing your build on PC, and is the reason why the SDK is not initializing.

Please download and install it here: https://www.oculus.com/setup/




Hello imperativity, I didn't have the Oculus Software when I was working on my proyect. I downloaded it and installed it, I don't have the oculus rift headset so I skipped the setup step. With the oculus software window open, I open my proyect in Unity and the same warning message appeared.
95rw98ral9yq.png

Did I make a wrong step?, if you need more Information please ask me and 

marko_rkm
Honored Guest


@marko_rkm
@markhansaven

Hi, we were unable to reproduce this behavior in both your sample project provided above, our internal project mirroring your own, and a new project using Unity 2017.4.0f1.

However, we were finally able to reproduce this behavior by stopping all services associated with the oculus runtime. Do you have the runtime installed on either of your machines you are building on? If so, are the services actively running in the background? The Oculus runtime is required for testing your build on PC, and is the reason why the SDK is not initializing.

Please download and install it here: https://www.oculus.com/setup/




Hello imperativity, I didn't have the Oculus Software when I was working on my proyect. I downloaded it and installed it, I don't have the oculus rift headset so I skipped the setup step. With the oculus software window open, I open my proyect in Unity and the same warning message appeared.
95rw98ral9yq.png

Did I make a wrong step?, if you need more Information please ask me and I'll give it.

marko_rkm
Honored Guest


@marko_rkm
@markhansaven

Hi, we were unable to reproduce this behavior in both your sample project provided above, our internal project mirroring your own, and a new project using Unity 2017.4.0f1.

However, we were finally able to reproduce this behavior by stopping all services associated with the oculus runtime. Do you have the runtime installed on either of your machines you are building on? If so, are the services actively running in the background? The Oculus runtime is required for testing your build on PC, and is the reason why the SDK is not initializing.

Please download and install it here: https://www.oculus.com/setup/




Hello imperativity, I didn't have the Oculus Software when I was working on my proyect. I downloaded it and installed it, I don't have the oculus rift headset so I skipped the setup step. With the oculus software window open, I open my proyect in Unity and the same warning message appeared.
95rw98ral9yq.png

Did I make a wrong step?, if you need more Information please ask me and I'll give it.

JGerard9582
Honored Guest
Hi, this thread has dried up. Can anyone confirm if there is a verified fix for this? Ive tried numerous suggestions outlined above and ive hit a brick wall. Im developing for gear vr. 

markhansaven
Explorer
Due to my financial situation I'm not gonna be able to resume deving for a while so I'm out. I hope the guys at Unity and Oculus can get together and get this working. It never had this problem for me with 2017.1, it all started for me when they changed the namespaces and methods from 'VR' to 'XR'.