Forum Discussion
marko_rkm
7 years agoHonored Guest
Virtual Reality SDK Oculus failed to initialize.
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:
When I put play in my game the following messages appear in my console:
-Virtual Reality SDK Oculus failed to initialize.
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:
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
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.
-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)
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
Replies have been turned off for this discussion
- markhansavenExplorerI'm getting a lot of problems from this Unity 2017.3.1f1 update just recently.
Firstly, it says in the editor 'Virtual Reality SDK Oculus failed to initialize.'. When building there's a libc error. Also, Google Cardboard is broken as well so now there's no fallback.
When looking at the updates this is what you see in Unity's website:- XR: Fixed single-pass shadow issue when used with Nvidia VRWorks. (None)
- XR: Fixed issue with capturing a screen shot image while in single-pass instancing mode. (None)
- XR: Removed application orientation settings disable when Virtual Reality Supported was enabled and updated info message related to the settings. (973918)
- XR: Fixed early out of Virtual Reality SDK list when SDKs that are unsupported in play mode try to initialize. Also Improved log messages around the Virtual Reality SDK list in Play Mode. (971293)
- XR: Update Google NDK to v1.100
- XR: Update Oculus to version 1.20
- XR: Update Vuforia to version 7.0.43
- XR: Added XR.WSA.HolographicSettings.IsContentProtectionEnabled. This gets or sets whether the app is displaying protected content. While content protection is enabled, rendered content will be visible only in the headset, disabling the Mixed Reality - Portal's preview.
- XR: Added XR.WSA.HolographicSettings.ReprojectionMode. This gets or sets the kind of reprojection the app is requesting to stabilize its holographic rendering relative to the user's head motion.
One awful solution that you can try is to create a brand new project and migrate your current project into that one. As of right now the Oculus Utilities project that I did that exact thing with, that was working for months, is now broken when building for the two most popular VR platforms. I will try an empty new project now and see if that works.
My guess is that there's some kind of interference, maybe that 'update to dll 1.20' when the latest dll is 1.21, not sure... - markhansavenExplorerOkay so I think VR is just broken in Unity now? When I start an empty project Google Cardboard does not work. I'm trying Oculus soon, that's very strange though. It's always worked on my computer...
Here's the error I get after building for android when trying to run VR Oculus:03-24 08:58:28.270: D/MdnieScenarioControlService(3702): packageName : com.TestProject.TestUnity className : com.unity3d.player.UnityPlayerActivity03-24 08:58:28.383: E/ExternalPlatformLocal(2026): isAudioHookingEnabledForApplication: com.TestProject.TestUnity03-24 08:58:28.387: A/libc(3503): Fatal signal 6 (SIGABRT), code -6 in tid 3520 (UnityMain)03-24 08:58:28.460: A/DEBUG(3577): pid: 3503, tid: 3520, name: UnityMain >>> com.TestProject.TestUnity <<<03-24 08:58:28.465: A/DEBUG(3577): #10 pc 00002774 /data/app/com.TestProject.TestUnity-1/lib/arm/libvrapi.so (vrapi_Initialize+5240)03-24 08:58:28.465: A/DEBUG(3577): #11 pc 000205f4 /data/app/com.TestProject.TestUnity-1/lib/arm/libOVRPlugin.so (_ZN3OVR4Util15CompositorVRAPI10InitializeEv+160)03-24 08:58:28.465: A/DEBUG(3577): #12 pc 000230e8 /data/app/com.TestProject.TestUnity-1/lib/arm/libOVRPlugin.so (_ZN3OVR4Util15CompositorVRAPI6CreateE17ovrpRenderAPITypePFv12ovrpLogLevelPKcEPviRK11ovrpVersionPPNS0_10CompositorE+96)03-24 08:58:28.465: A/DEBUG(3577): #13 pc 000134b0 /data/app/com.TestProject.TestUnity-1/lib/arm/libOVRPlugin.so (ovrp_Initialize4+84)03-24 08:58:28.465: A/DEBUG(3577): #14 pc 00978404 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #15 pc 009780c4 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #16 pc 0076c3dc /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #17 pc 0076bce0 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #18 pc 0014be70 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #19 pc 002d8a5c /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #20 pc 004e42b8 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #21 pc 004e773c /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #22 pc 00019939 /data/app/com.TestProject.TestUnity-1/oat/arm/base.odex (offset 0x19000)03-24 08:58:29.142: W/ActivityManager(3702): Force finishing activity com.TestProject.TestUnity/com.unity3d.player.UnityPlayerActivity - marko_rkmHonored Guest
I only was able to send the scene in a zip, the whole project it's a quite of big even compressed in a zip, but if you need the complete project you can download it with the next link to my project's folder in dropbox:
imperativity said:
Hi,
From a quick look at your scene, you don't have any components added that would need to call your APP ID. I also could not reproduce this issue with an exact scene mirroring yours, adding the OVRPlayerController prefab as you did---which allows basic movement and our OVRManager script to function as expected.
Would you be willing to provide a copy of your project for me to analyze?
Also, you are certain that you have "oculus" added to your virtual reality SDKs in your XR Settings in your player settings menu in Unity?
https://www.dropbox.com/sh/grwjumtsz0kuvx6/AABIj0HBcc_5Oa3cJZsenI8ga?dl=0
I added the "oculus" option in XR Settings, even I have the "Virtual Reality Supported" Option" , but the same warning message still appearing, I don't have any problem when I push the play buttom to the game mode and I haven't tried to build the game yet, but I don't know if using the Oculus assets without the SDK would bring me problems when I develop my project.
this is a XR Settings's screenshot in game mode:
Also thank you very much for the support. I really appreciate it. - marko_rkmHonored Guest
markhansaven said:
Okay so I think VR is just broken in Unity now? When I start an empty project Google Cardboard does not work. I'm trying Oculus soon, that's very strange though. It's always worked on my computer...
Here's the error I get after building for android when trying to run VR Oculus:03-24 08:58:28.270: D/MdnieScenarioControlService(3702): packageName : com.TestProject.TestUnity className : com.unity3d.player.UnityPlayerActivity03-24 08:58:28.383: E/ExternalPlatformLocal(2026): isAudioHookingEnabledForApplication: com.TestProject.TestUnity03-24 08:58:28.387: A/libc(3503): Fatal signal 6 (SIGABRT), code -6 in tid 3520 (UnityMain)03-24 08:58:28.460: A/DEBUG(3577): pid: 3503, tid: 3520, name: UnityMain >>> com.TestProject.TestUnity <<<03-24 08:58:28.465: A/DEBUG(3577): #10 pc 00002774 /data/app/com.TestProject.TestUnity-1/lib/arm/libvrapi.so (vrapi_Initialize+5240)03-24 08:58:28.465: A/DEBUG(3577): #11 pc 000205f4 /data/app/com.TestProject.TestUnity-1/lib/arm/libOVRPlugin.so (_ZN3OVR4Util15CompositorVRAPI10InitializeEv+160)03-24 08:58:28.465: A/DEBUG(3577): #12 pc 000230e8 /data/app/com.TestProject.TestUnity-1/lib/arm/libOVRPlugin.so (_ZN3OVR4Util15CompositorVRAPI6CreateE17ovrpRenderAPITypePFv12ovrpLogLevelPKcEPviRK11ovrpVersionPPNS0_10CompositorE+96)03-24 08:58:28.465: A/DEBUG(3577): #13 pc 000134b0 /data/app/com.TestProject.TestUnity-1/lib/arm/libOVRPlugin.so (ovrp_Initialize4+84)03-24 08:58:28.465: A/DEBUG(3577): #14 pc 00978404 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #15 pc 009780c4 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #16 pc 0076c3dc /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #17 pc 0076bce0 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #18 pc 0014be70 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #19 pc 002d8a5c /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #20 pc 004e42b8 /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #21 pc 004e773c /data/app/com.TestProject.TestUnity-1/lib/arm/libunity.so03-24 08:58:28.465: A/DEBUG(3577): #22 pc 00019939 /data/app/com.TestProject.TestUnity-1/oat/arm/base.odex (offset 0x19000)03-24 08:58:29.142: W/ActivityManager(3702): Force finishing activity com.TestProject.TestUnity/com.unity3d.player.UnityPlayerActivity
I also try to use Google Cardboard, before using Oculus, in the newest verson of Unity (Unity 2017.3.1f1) and I wasn't able to build it, when I open my project these kind of warning messages also appear:- Assets/OvrAvatar/Samples/SocialStarter/Assets/Scripts/RoomManager.cs(31,15): warning CS0618: `Oculus.Platform.Rooms.SetRoomInviteNotificationCallback(Oculus.Platform.Message<string>.Callback)' is obsolete: `Deprecated in favor of SetRoomInviteAcceptedNotificationCallback'
- Assets/OvrAvatar/Samples/SocialStarter/Assets/Scripts/RoomManager.cs(93,22): warning CS0618: `Oculus.Platform.Models.Room.Owner' is obsolete: `Deprecated in favor of OwnerOptional'
- markhansavenExplorerI just re-downloaded, fresh install of Unity on two separate computers and indeed it states 'Virtual Reality SDK Oculus failed to initialize.".
This is using Unity's 2017.4.0f1 on two separate computers! Google VR, Oculus VR do not work!!
Guys, I think we all need to submit a ticket. If you one of you two do it I will immediately respond and thumbs this up, this is a very serious issue, out of the box now Unity is not working with any VR!
There is one thing, though. Both of these computers have only one thing in common which is that they have run a project that used oculus utilities imported. I'm wondering if it's possible that oculus utilities when imported adds something externally to your computer outside of your unity installation that is staying there, or is it just simply that Unity is now broken completely to use VR out of the box!
I've posted a topic about it on the Unity forums here:
https://forum.unity.com/threads/vr-is-broken-on-2017-3-1f1-cardboard-and-oculus.523397/
We need to submit a ticket though because this is a serious problem with Unity now...
- markhansavenExplorer
imperativity said:
@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/
Oculus has always worked right out of the box in Unity. My VR setup was working last month and now it isn't.
Not only is Oculus not working, but cardboard and OpenVR are also not working. - ssedlmayr_nomadExplorer@imperativity I'm having the same issue as well with Unity 2018.1.0813 and the 1.24 SDK. Try harder maybe?
- ssedlmayr_nomadExplorer@markhansaven @marko_rkm I rolled back to 1.22, since that's the version bundled with the latest version of Unity and it's still busted. It may be a Unity issue, but it doesn't look like we will get any support from Unity or Oculus any time soon. I'll let you know if I find anything on the Unity forums.
- ssedlmayr_nomadExplorer@markhansaven @marko_rkm the only thing that seems to work is rolling back to version 1.22; launching your app via Unity editor by hitting the play button; and/or then launching it from the runtime screen (I haven't verified whether it will run on its own directly from the runtime). If it only works from the runtime, then things like runtime debugging may not be possible. We also can't get controllers to work atm. My company has Monday off for Easter, but if we find a solution (our business depends on it), I'll post it here.
- markhansavenExplorer
imperativity said:
@ssedlmayr_nomad
Hi,
We are actively looking into this issue and have spent time trying to reproduce this internally, to no avail.
I have the following questions to ask you:
1) Is your runtime the latest?
2) Do you have any pending updates to install in the runtime if it is the latest version?
3) Can you provide me with log files from your runtime by running "C:\Program
Files\Oculus\Support\oculus-diagnostics\OculusLogGatherer.exe" to give me added visibility into this issue on your end?
Please understand that we are here to help and have been internally looking into this since it has first been reported.
I don't understand how you couldn't reproduce the issue...I would say just get a computer, install Unity on it as the only application, and just playtest in the editor. Unity is supposed to work out of the box with all of the sdks it installs with. It is broken with both OpenVR and Oculus platforms as it says "Failed to Initialize" with both, not just with Oculus VR.
I post in depth the first errors that I had received after it was built. It would build for Android, but it won't start the application:
https://forum.unity.com/threads/vr-is-broken-on-2017-3-1f1-cardboard-and-oculus.523397/#post-3442312
No one seems to be responding on the forums which is very odd to me as it is broken on three separate computers with a fresh install of Unity and blank new projects, and since so many people seem to also be going through this.
You have to understand that there was never a need to install any separate windows oculus runtime, and people like me are developing for or at least trying to develop for GearVR/Go and Cardboard. Unity should work straight out of the box with both OpenVR and Oculus, as it has been up until last month.
I will try rolling back to 2017.2 and see if that works, it seems to be ever since the 2017.3.1 update and in the logs Unity says they had updated the Oculus sdk on that update. I don't think it's the Oculus sdk at all, I think it's that upon updating Unity they did something to make Unity look in the wrong location for files or hardwired it where it can't find certain Oculus components right out of the box.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 months ago
- 3 years ago