[Unity 5.3] Starting VR Development on Mac with unity 5.3 and Cardboard

Hi guys,
I am trying to develop a VR app on Mac with unity 5.3 and I have some questions. First : I downloaded the plugin « VR Sample » and tried to launch it to test and understand how VR works.

My system is Mac OS X 10.11.3

With unity 5.3.4.f1:
I haven’t compile error when I launched a scene like Flyer but when it start, I have this one :

[Error] Couldn’t open /Applications/Unity - 5.3.4f1/Unity.app/Contents/VR/oculus/macosx64/OVRPlugin.bundle/Contents/MacOS/OVRPlugin, error: dlopen(/Applications/Unity - 5.3.4f1/Unity.app/Contents/VR/oculus/macosx64/OVRPlugin.bundle/Contents/MacOS/OVRPlugin, 2): Library not loaded: @rpath/LibOVRRT_0.framework/Versions/5/LibOVRRT_0
Referenced from: /Applications/Unity - 5.3.4f1/Unity.app/Contents/VR/oculus/macosx64/OVRPlugin.bundle/Contents/MacOS/OVRPlugin

and some other like those :
[Error] Could not load symbol ovrp_Initialize : invalid handle passed to dlsym()
[Warning] VR: Oculus could not be loaded: Failed to load symbol ovrp_Initialize.

and like those :
[Error] Could not load symbol ovrp_GetStatus2 : invalid handle passed to dlsym()

and the last :
[Error] [VRDevice] Initialization of device oculus failed.

I understand it’s because Unity don’t find some oculus files but I want to develop for cardboard, so can I change this configuration ?
I have found some informations in this forum and in the Internet but it’s often for an older version (like 5.1) and I understand that VR implementation changed a lot since. So I’m not sure of what tutorial I can follow to learn. Lots of them are for VR with Oculus so I’m not sure about their validity for my case.

Do I need to plug a Cardboard or another device (like an iPad) to run samples ?
How can I test samples and personal test in Editor Mode ? Do I need necessarily a Cardboard ou another device (like an iPad) to test ?
Do I need to install the Google cardboard SDK ?

If you have some instructions for me, you are welcome !
I hope it’s enough clear, thanks for your help.

Hy,
you don’t need the VR samples when your target is Google Cardboard. Just download the cardboard SDK + samples for Unity and play around with them. DL-Link: Downloads and samples  |  Google VR  |  Google for Developers

When you want to test the VR samples with cardboard there are nice youtube tutorials from NurFACEGAMES (for example The Flyer)

Don’t forget to UNCHECK the Virtual Reality Supported checkbox in player settings! After converting the samples to cardboard you can easily test them in Editor, using Ctrl and Alt-Left keys for head rotation and tilt.

Best regards

Hello @Red_Dragon69 , thanks for your reply.
I tested with the cardboard SDK and I have good control in one Scene (DemoScene → HeadsetDemo) in the editor mode. In other scenes like ControllerDemo, I can’t get through the connection step of controller. I thought it was because I needed to build a scene and test it with a tablet but that failed.

I have a popup error :
« Failed to recompile android resource files. See the Console for details. »
In console :
[Error] Failed to compile resources with the following parameters:
-bootclasspath “/Users/kiupe2/Library/Android/sdk/platforms/android-24/android.jar” -d “/Users/kiupe2/Documents/Unity/gvr-unity-sdk-master/Samples/CastleDefense/Temp/StagingArea/bin/classes” -source 1.6 -target 1.6 -encoding UTF-8 “com/google/castledefense/R.java” “com/google/vr/cardboard/R.java” “vr/gvr/platform/unity/R.java”
warning: /Users/kiupe2/Library/Android/sdk/platforms/android-24/android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: /Users/kiupe2/Library/Android/sdk/platforms/android-24/android.jar(java/lang/AutoCloseable.class): major version 52 is newer than 51, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
2 warnings
UnityEditor.HostView:OnGUI()

[Error] UnityException: Resource compilation failed!
Failed to recompile android resource files. See the Console for details.
UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message, System.Exception ex)
UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

I tried some solutions I have found but they don’t fix my bug. I am not sure how I can fix it.
So I tried to start a new project with only GoogleVRForUnity package (which have a folder GoogleVR and another Plugins). I created a scene with a cube and I did the built.
Same error.

Virtual reality support is unchecked, android build is installed, Android Studio is installed and Android 6.X SDK and Android 6.0 SDK are installed too.
I don’t understand why and I have no idea.
So I will begin to watch from NurFACEGAMES in hope to gain an understanding of my problem.

Hy ** @Ewakhine **
as I now look on your error messages, there is one thing I have to ask: Do you also have the whole Android 5 stuff installed? Because I think, the compiler does not fully support Android 6 yet. I think the best way to solve this, is to install Android 5 and 5.X SDK and try again.

[quote=“Ewakhine, post:3, topic: 631715, username:Ewakhine”]
**[/quote]
**[quote=“Ewakhine, post:3, topic: 631715, username:Ewakhine”]
warning: /Users/kiupe2/Library/Android/sdk/platforms/android-24/android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
[/quote]

Best regards

Hey, thanks for your reply!

I haven’t Android 5 stuff installed and, yes, it’s maybe my problem. I haven’t time to test it (another member of my team take this project) but I want to thank you again for your instructions and help.

Best regards

1 Like

I recently had many of these issues. I had to use some older versions of tool in my SDK. The new versions have compatibility issues. Here’s what my SDK Manager looks like now.

1 Like