Unity 5.1.0p1 Crashing on GearVR

Hi,

I’m failing to run GearVR game with new Unity 5.1.0p1. It gives me the following errors on logcat:

  • Unable to find OculusInitPlugin
  • Can’t add component because class ‘OVRManager’ (and OVRCameraRig) doesn’t exist!

I was previously using Oculus plugin. I removed OVR and Plugins folder, installed Oculus 0.6.0 runtime, Enabled VR Support in player settings.

Also, Editor Mode is not working using any of the available VR.DeviceTypes as loadedDevice. Is GearVR supported in Editor Mode?

Thanks,
Phil

Yes GearVR is supported using VRDeviceType.oculus. When running in the Editor you need to have a rift attached as both GearVR and Oculus use the same plugin, but the editor is set to display on the rift.

The two errors that you are seeing are due to an object in the scene that is still trying to access the legacy OVRManager and CameraRig. Your scene should not contain any legacy objects or prefabs otherwise you will receive errors.

Are you seriously saying that to do Gear VR development in the Editor we now have to have a Rift?

Ed unity - I had the same problem as phil_lira and deleted the exact same folders as him. To get a good baseline test on my Gear VR, I started a new project.

I’m seeing the same errors about OVRCameraRig, etc. as phil_lira on a BLANK project with no scripts, 2 cubes and a D-Light! “VR Supported” is checked. My tiny little test app crashes back to the Samsung VR Dashboard (which was built with 4.6.3p2, hence that entry after my app crashes) the moment I don the Gear VR (or stick my finger by the sensor to fool it!).

What’s going on, here?

Here’s my logcat file which I made sure to clear right before I ran my test app:

C:\Users\PLF User\AppData\Local\Android\android-sdk\platform-tools>adb logcat -s
 "Unity"
--------- beginning of main
--------- beginning of system
I/Unity   (19093): Home was resumed
I/Unity   (19093):
I/Unity   (19093): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (19093):
I/Unity   (19093): OnApplicationPause() False
I/Unity   (19093):
I/Unity   (19093): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (19093):
I/Unity   (19093): DashboardConfigureVR::ResetOrientation
I/Unity   (19093):
I/Unity   (19093): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (19093):
I/Unity   (19093): Home was suspended
I/Unity   (19093):
I/Unity   (19093): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (19093):
I/Unity   (19093): OnApplicationPause() True
I/Unity   (19093):
I/Unity   (19093): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (19093):
I/Unity   (19093): OnApplicationFocus() False
I/Unity   (19093):
I/Unity   (19093): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (19093):
D/Unity   (20422):  GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync G
L_OES_vertex_half_float GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_compr
essed_ETC1_RGB8_texture GL_AMD_compressed_ATC_texture GL_KHR_texture_compression
_astc_ldr GL_OES_texture_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_f
ormat_BGRA8888 GL_OES_texture_3D GL_EXT_color_buffer_float GL_EXT_color_buffer_h
alf_float GL_QCOM_alpha_test GL_OES_depth24 GL_OES_packed_depth_stencil GL_OES_d
epth_texture GL_OES_depth_texture_cube_map GL_EXT_sRGB GL_OES_texture_float GL_O
ES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_line
ar GL_EXT_texture_type_2_10_10_10_REV GL_EXT_texture_sRGB_decode GL_OES_element_
index_uint GL_EXT_copy_image GL_EXT_geometry_shader GL_EXT_tessellation_shader G
L_OES_texture_stencil8 GL_EXT_shader_io_blocks GL_OES_shader_image_atomic GL_OES
_sample_variables GL_EXT_texture_border_clamp GL_EXT_multisampled_render_to_text
ure GL_OES_shader_multisample_interpolation GL_EXT_texture_cube_map_array GL_EXT
_d
D/Unity   (20422): raw_buffers_indexed GL_EXT_gpu_shader5 GL_EXT_robustness GL_E
XT_texture_buffer GL_OES_texture_storage_multisample_2d_array GL_OES_sample_shad
ing GL_OES_get_program_binary GL_EXT_debug_label GL_KHR_blend_equation_advanced
GL_KHR_blend_equation_advanced_coherent GL_QCOM_tiled_rendering GL_ANDROID_exten
sion_pack_es31a GL_EXT_primitive_bounding_box GL_OES_standard_derivatives GL_OES
_vertex_array_object GL_EXT_disjoint_timer_query GL_KHR_debug GL_EXT_sRGB_write_
control
E/Unity   (20422): Can't add component because class 'OVRManager' doesn't exist!

E/Unity   (20422):
E/Unity   (20422): (Filename:  Line: 691)
E/Unity   (20422):
E/Unity   (20422): Can't add component because class 'OVRCameraRig' doesn't exis
t!
E/Unity   (20422):
E/Unity   (20422): (Filename:  Line: 691)
E/Unity   (20422):
E/Unity   (20070): Unable to find OculusInitPlugin
D/Unity   (20070): GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_externa
l GL_OES_EGL_sync GL_OES_vertex_half_float GL_OES_framebuffer_object GL_OES_rgb8
_rgba8 GL_OES_compressed_ETC1_RGB8_texture GL_AMD_compressed_ATC_texture GL_KHR_
texture_compression_astc_ldr GL_OES_texture_npot GL_EXT_texture_filter_anisotrop
ic GL_EXT_texture_format_BGRA8888 GL_OES_texture_3D GL_EXT_color_buffer_float GL
_EXT_color_buffer_half_float GL_QCOM_alpha_test GL_OES_depth24 GL_OES_packed_dep
th_stencil GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_EXT_sRGB GL_OES
_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_text
ure_half_float_linear GL_EXT_texture_type_2_10_10_10_REV GL_EXT_texture_sRGB_dec
ode GL_OES_element_index_uint GL_EXT_copy_image GL_EXT_geometry_shader GL_EXT_te
ssellation_shader GL_OES_texture_stencil8 GL_EXT_shader_io_blocks GL_OES_shader_
image_atomic GL_OES_sample_variables GL_EXT_texture_border_clamp GL_EXT_multisam
pled_render_to_texture GL_OES_shader_multisample_interpolation GL_EXT_texture_cu
be
D/Unity   (20070): _map_array GL_EXT_draw_buffers_indexed GL_EXT_gpu_shader5 GL_
EXT_robustness GL_EXT_texture_buffer GL_OES_texture_storage_multisample_2d_array
 GL_OES_sample_shading GL_OES_get_program_binary GL_EXT_debug_label GL_KHR_blend
_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_QCOM_tiled_renderi
ng GL_ANDROID_extension_pack_es31a GL_EXT_primitive_bounding_box GL_OES_standard
_derivatives GL_OES_vertex_array_object GL_EXT_disjoint_timer_query GL_KHR_debug
 GL_EXT_sRGB_write_control
I/Unity   (20070): Default GameObject BitMask: UI already registered
I/Unity   (20070):
I/Unity   (20070): (Filename:  Line: 169)
I/Unity   (20070):
I/Unity   (20070): Unity Version: 4.6.3p2
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): Inhibiting Entitlement Check!
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): Creating volume controller...
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): OnApplicationFocus() True
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): DashboardConfigureVR::ConfigureVrModeParms
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): True device model: Note4_Universal samsung SAMSUNG-SM-N910A
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
W/Unity   (20070): The referenced script on this Behaviour is missing!
W/Unity   (20070):
W/Unity   (20070): (Filename:  Line: 1771)
W/Unity   (20070):
I/Unity   (20070): Home was suspended
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): OnApplicationPause() True
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):
I/Unity   (20070): OnApplicationFocus() False
I/Unity   (20070):
I/Unity   (20070): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 56)
I/Unity   (20070):

@snowsrfr1 Could you submit a bug report with your project and post the bug report number? I’ve not been able to reproduce the error using a new project and enabling Virtual Reality Supported and deploying an Android Player. It works properly on the GearVR. A bug report that I can reproduce with would definitely help.

@adamhill At the moment yes you need to have a rift in order to run in the Editor. We are working on finding a solution for this problem. For now, if you don’t have a rift you will need to go through the nasty process of deploying to android for each run. We understand this is a huge problem and apologize that we don’t already have a solution in place. Having the option to deploy now makes a smooth workflow for creating a single app for GearVR and Rift. Otherwise they would need to switch between the Legacy Plugin and Native Integration.

Ed unity,

We still need an oculussig file in /Assets/Plugins/Android/assets, correct?

I will .zip up my project after doing a little more hunting into my dev environment and get back to you today. I do also have 5.0.1p2 installed on the same machine in a different directory for another project.

Ed Unity,

I’ve filed case 705638 in the bug reporter, with my project, editor files, and logcat output attached.
Hopefully I’m just doing something wrong which is trivial and/or stupid.

I’ve just download and tested your project with a fresh install of 5.1.0p1 and I was able to run in the Editor without making any changes to your project and I was also able to build and deploy to GearVR with only adding my Note4’s signature file to the Assets/Plugins/Android/assets folder. I’m not sure how you are receiving this error in the project that you sent. Could you try either re-installing 5.1.0p1 or installing the official 5.1.1f1 (released yesterday). See if that resolves the crash.

I deleted 5.1.0p1 and installed 5.1.1f1:

Same results with my old project.
Same results with a new project.
Same results on a colleague’s Note 4.

I have Unity 5.1.1f1 installed in \Program Files\Unity 5.1 and Unity 5.0.1p2 installed in \Program Files\Unity
One of the old workarounds in 5.0.x was to copy OculusPlugin.dll into the Unity/Editor folder (which worked for me some time ago)… Perhaps my 5.1.1f1 installation is pulling OculusPlugin.dll from my 5.0.1p2 installation folder?

EDIT: Nope… tried that, too :frowning:

I’m going to keep looking into this and post results. @phil_lira - where are you with this issue? You are the OP :slight_smile:

@snowsrfr1 In the new project, try removing the Legacy Plugin from the plugins folder if it is there. I don’t remember if it was in the project you sent, but just in case.

I promise you it was not. The project didn’t contain anything but a .unity scene containing two cubes and a d-light, along with my osig file. It’s gotta be some kind of machine / environment thing, but it sure is driving me up a wall!

I’m seeing the same here. Basically empty project with a scene with some cubes and a camera, building and getting an <App_Name> has closed unexpectedly message when launching.

I’m also seeing the below in logcat.

Can't add component because class 'OVRManager' doesn't exist!
E/Unity   (19496): 
E/Unity   (19496): (Filename:  Line: 691)
E/Unity   (19496):
E/Unity   (19496): Can't add component because class 'OVRCameraRig' doesn't exist!
E/Unity   (19496): 
E/Unity   (19496): (Filename:  Line: 691)
E/Unity   (19496):

Dumb question: I’m running Unity on a mac, is building to gear vr only supported on windows?

On Mac also - I have yet to get Unity 5.1p1 and oculus 0.6.0.1 to work with the VR Player set to on.
It always crashes on start.

With this same setup and the Oculus package it compiled but produces images only in the left eye. Right eye is black.

Flagged by Oculus today that the actual Mac Android SDK was broken and should be updated. I can now build the Native code samples. Have not had time to try Unity builds with it but it’s possible part of same issue?

@snowsrfr1 Could you send me a full logcat of the app running on the device?
Do the following steps:

  1. Go to your Android sdk install/platform-tools folder in the command window.
  2. Make sure your app isn’t running on the device and the device is connected to the computer.
  3. In the command window run:
    adb tcpip 5555
  4. Disconnect the device from the computer.
  5. In the command window run:
    adb connect device’sIPaddress:5555
    adb logcat -c
    adb logcat -vtime > GearVRCrash.log
  6. Run the app on your device.
  7. After it crashes press Ctrl+C in the command window.

You will then have a full log called GearVRCrash.log in your platform-tools folder. Send that to us either on this forum or through the bug report you created.

log file attached and zipped. I tired to minimize the time between clearing the log file and attaching the Note 4 into the Gear VR, but as you know, there’s a LOT of stuff being written to the log at any given time.

Looks like there’s an exception that gets thrown when getApplicationName gets called. Things so south fairly quicky from there but you will see the errors about the legacy OVR components, followed by a segfault in UnityMain.

I hope this helps!

2167196–143375–GearVRCrash.zip (80.8 KB)

Hey all I’m crashing here too.

Using Samsung Galaxy 6 Edge, and the Unity 5.1.1F1 release.

I created a scene with a cube/sphere/directional light. I put my signature file in /assets/. I enabled VR and multithreaded rendering and clicked build.

I get a spinning wheel for a moment then it crashes to the Gear VR room.

I found this in the logcat,

E/Unity (20420): Unable to find OculusInitPlugin

Do you want me to send in my project/log file as well?

Edit: Oculus version 6.0.0 installed on PC
i’m building from Windows 7

Do you want my LogCat and project files?

Just to let everyone know where I’m at:

I am able to run using Oculus SDK v0.6 with Unity 5.0.1p2. If you folks need an immediate plan B, I can verify that this combination of the editor / SDK can work.

I asked on of my team members to build my app (mentioned above Unity 5.1.0p1 Crashing on GearVR - Unity Engine - Unity Discussions) on a windows machine and it apparently worked.

EDIT:
Apparently he tested on a DK2, not GearVR. I’ll post the success of his GearVR build when I have the results.

@scottunity:

Do you happen to have a link to that? Can’t seem to find it anywhere.

Hi all.

@snowsrfr1 I’m sorry for being away. I was out of office due to a health issue a while after I posted this and just got back today. I still can’t build for GearVR on NativeVR.

@Ed_unity I checked my Editor Build Log and there’s no mention of OVRPlugin.dll on it. Shouldn’t it be loaded as a native extension module? As a matter of fact, there’s no mention to anything VR at all. which is rather strange.

Can you confirm you are building this with a Rift disconnected from your PC? Peharps Unity might check for that and include the right dependencies when Rift is connect.

I attached my Editor log in case it helps track the error.

Thanks,

2170719–143637–Editor.txt (33.1 KB)

Thanks for the logs, we now know what the issue is and we are working on a fix that we hope to be available in 5.1.1p2. This issue is with Android Personal license. So if you have Android Personal, you should just need to include the Oculus Plugin, the OVRCameraRig and OVRManager scripts in your application in order to workaround the issue and still use the Native Unity Integration. Otherwise, only use the Oculus Plugin. I’m confirming this workaround works as well and will keep you guys updated.

1 Like