Skip to main content
Inspiring
August 13, 2018

Why can't I Initialise Oculus on Gear VR

I am trying to perform an entitlement check.
Nothing at all runs in the script after the Oculus.Platform.Core.AsyncInitialize(); not even update.
I have tried on a version downloaded from the store in the Release Channel.
No errors are caught.
Running on Gear VR doesn't.

The script works fine on PC.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Platform;

public class OculusEntitlmentCheck : MonoBehaviour
{
    public TextMesh debugText;
    public TextMesh debugText2;

    void Awake()
    {
        debugText.text = "entitlementCheckScriptAwake";
        if (OculusDeviceToggle.isRunningOnOculus)
        {
            debugText.text = "checking entitlment";
            try
            {
                debugText.text = "initializing oculus 1";
                Oculus.Platform.Core.AsyncInitialize();
                debugText.text = "initializing oculus 2";
                Entitlements.IsUserEntitledToApplication().OnComplete(GetEntitlmentCallback);
                debugText.text = "initializing oculus 3";
            }
            catch (UnityException e)
            {
                debugText.text = "oculus initialisation failed";
                Debug.LogException(e);
                Quit();
            }
        }
    }

    void GetEntitlmentCallback(Message msg)
    {
        if(msg.IsError)
        {
            Debug.LogError("You are NOT entitled to use this app.");
            Quit();
        }
        else
        {
            debugText.text = "you are entitled to this app";
        }
    }

    void Quit()
    {
        debugText.text = "Quit function running";
        UnityEngine.Application.Quit();
    }
}

    This topic has been closed for replies.

    1 reply

    Participant
    August 15, 2018
    Hi @viewport,

    Where did you get the Platform SDK, was it from our site, or with the Oculus Integration from the Unity Asset Store?

    I believe the problem is you are missing libovrplatformloader.so in your built project. Can you look in your project under Assets->Plugins->Android->libs->armeabi-v7a for libovrplatformloader.so?

    If you don't have the library, can you try re-importing the Platform SDK and look to see if it is importing the platformloader. I am attaching a screenshot of the import.


    Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations. Having an issue with our platform, services, or integrations? Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.