/ Forums
Applications are now open to attend this year's Oculus Connect. Join us October 11–12 and be first in line for an inside look at what’s new and next for VR.

Oculus Connect 4: Speaker Preview

We've revealed some of the Oculus speakers who'll present at Oculus Connect 4 this year! Click here to learn more.
New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Unity Open VR application launched from within android application

fogxfogx Posts: 1
Virtual Boy (or Girl)
Hello,

I am trying to launch a Unity VR scene with the OVR plugin from another android application (for Gear VR). I have exported the unity scene and added it to my app through an .aar library.
When i launch the unity scene, logcat outputs this error:

E/Unity: Unable to find OVRPlugin
I/Unity: Unity v5.6.1f1, Oculus Utilities v1.12.0, OVRPlugin v0.0.0, SDK v0.0.0.
Stacktrace is not supported on this platform.
(Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
08-11 12:58:48.592 30961-31265/com.lonewolf.sympatientprototype01 I/Unity: DllNotFoundException: OVRPlugin
at (wrapper managed-to-native) OVRPlugin/OVRP_1_1_0:0vrp_GetNodePresent (OVRPlugin/Node)
at OVRPlugin.get_hmdPresent () [0x00000] in <filename unknown>:0
at OVRManager.get_isHmdPresent () [0x00000] in <filename unknown>:0
at OVRManager.set_chromatic (Boolean value) [0x00000] in <filename unknown>:0
at OVRManager.Awake () [0x00000] in <filename unknown>:0

W/Unity: You SHOULD create a Unity layer named 'CloudsToy' or this asset will use the 30th layer by default.
Stacktrace is not supported on this platform.


this repeats for about 100 times, then the following error is repeated endlessly. The screen where the unity splash and then the scene itself should show up is white and not populated (checked with android layout inspector)


(Filename: Line: -1)
I/Unity: NullReferenceException: Object reference not set to an instance of an object
at OVRCameraRig.UpdateAnchors () [0x00000] in <filename unknown>:0
at OVRCameraRig.FixedUpdate () [0x00000] in <filename unknown>:0


How can i fix this issue/ make unity find the OVR plugin? I have tried adding it into the android project by itself, but this would probably also require a call to unity to register the plugin as well(?)

Comments

  • imperativityimperativity Posts: 1,172 Oculus Staff
    Hi,

    Welcome to the Oculus Developer Forums.

    There isn't a convenient way to toggle VR right now because we always use Samsung's "vr_only" attribute in AndroidManifest.xml.

    There is a planned fix in the works that will make UnityEngine.VR.VRSettings.enabled to work like it does on Rift.

    There is a method available here that may address this. Also, this asset store package on Unity can accomplish the same thing as well. You can find it here.



Sign In or Register to comment.