Search Unity

Unity 5.6.2 + Google VR SDK 1.60 does not work in stereoscopic view on Android device

Discussion in 'AR/VR (XR) Discussion' started by mariobuonocore1, Jul 2, 2017.

  1. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
    Hi all,
    I'm studying how to create mobile VR videogames for android using Google cardboard, but without success.
    I installed Unity 5.6.2f1, configured Android SDK, JDK and NDK and downloaded last GoogleVRForUnity package (version 1.60) from Google developer website.
    I followed step by step the tutorial at https://developers.google.com/vr/unity/get-started :

    - Creating a new 3D project
    - Import the Google VR Unity package
    - Switch Platform to Android
    - Enable Virtual Reality Supported and add Cardboard in the Virtual Reality SDKs section
    - Set Minimum API Level to 19 and change Pakage Name
    - Adding the demo scene GVRDemo to Build Setting
    - Click the Build and Run button

    On my android mobile devices, Asus Zenfone 2 and Asus Fonepad 7, the demo application run as a normal application and not as VR application: screen is not stereoscopic and camera not rotate on smartphone rotation.

    I have also tried to create a new scene and add just a cube, but on my mobile devices nothing change, the scene run as a normal application.

    Somebody can help me, please? I just want to understand how to create a stereoscopic view application for virtual reality with Google cardboard.
    Thanks in advance,

    Mario
     
    Nabeel-Ahmed likes this.
  2. xslipstream

    xslipstream

    Joined:
    Feb 3, 2017
    Posts:
    17
    I think I am having the same problem. Ever since I upgraded to 5.6.2f1 from 5.5, I haven't gotten any of my google cardboard projects to work properly. Bumping this
     
    mariobuonocore1 likes this.
  3. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
    I did the update to version 5.6.2p1 but the problem was not resolved. I opened a bug, I hope I can be helped...
     
  4. DHein

    DHein

    Joined:
    Jan 26, 2016
    Posts:
    38
    I have been building for cardboard and daydream throughout many Unity 5.6 builds, including the 5.6.1f1 and can confirm that VR works on both samsung galaxy phones as well as the google pixel. Nontheless you need some tweeks to make it actually run without errors / crashes.

    Do you get any errors when running the app on the phone?
    Try to run the adb logcat in order to see the console output when the app tries to initiate the vr mode.
     
  5. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
    Here the logs captured with logcat, the first exception I can see is Unable to find gvr and after DllNotFoundException: gvr


    E/Unity ( 8866): Unable to find AudioPluginOculusSpatializer
    E/Unity ( 8866): Unable to find libaudioplugingvrunity
    E/Unity ( 8866): Unable to find libAudioPluginOculusSpatializer
    D/Unity ( 8866): GL_EXT_debug_marker GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_vertex_half_float GL_OES_texture_float GL_OES_texture_half_float GL_OES_element_index_uint GL_OES_mapbuffer GL_OES_fragment_precision_high GL_OES_compr
    essed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_required_internalformat GL_OES_depth_texture GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_standard_derivatives GL_OES_vertex_array_object GL
    _OES_egl_sync GL_OES_texture_npot GL_OES_surfaceless_context GL_EXT_discard_framebuffer GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_multisampled_render_to_texture GL_EXT_shader_texture_lod GL_EXT_texture_format_BGRA8888 GL
    _EXT_occlusion_query_boolean GL_EXT_texture_rg GL_EXT_draw_buffers GL_EXT_shader_framebuffer_fetch GL_IMG_shader_binary GL_IMG_texture_compression_pvrtc GL_IMG_texture_compression_pvrtc2 GL_IMG_texture_npot GL_IMG_texture_format_B
    GRA8888 GL_IMG_read_format GL_IMG_program_binary GL_IMG_uniform_buffer_object GL_IMG_multisampled_render_to_texture GL_KHR
    D/Unity ( 8866): _debug
    I/ActivityManager( 475): Start proc com.asus.photoclusteringserviceg for broadcast com.asus.gallery/com.asus.photoclusteringservice.PhotoClusteringBroadcastReceiver: pid=8962 uid=10000 gids={50000, 9997, 3003, 1028, 1015, 1023} a
    bi=x86
    I/ActivityManager( 475): Killing 8258:com.google.android.gms:snet/u0a9 (adj 15): empty #17
    D/Unity ( 8866): #version 100
    D/Unity ( 8866): #extension GL_EXT_frag_depth : enable
    D/Unity ( 8866): precision highp float;
    D/Unity ( 8866): uniform highp vec4 _ProjectionParams;
    D/Unity ( 8866): uniform highp vec4 _ZBufferParams;
    D/Unity ( 8866): uniform highp mat4 unity_CameraToWorld;
    D/Unity ( 8866): uniform highp mat4 _NonJitteredVP;
    D/Unity ( 8866): uniform highp mat4 _PreviousVP;
    D/Unity ( 8866): uniform highp sampler2D _CameraDepthTexture;
    D/Unity ( 8866): varying highp vec2 xlv_TEXCOORD0;
    D/Unity ( 8866): varying highp vec3 xlv_TEXCOORD1;
    D/Unity ( 8866): void main ()
    D/Unity ( 8866): {
    D/Unity ( 8866): highp vec4 tmpvar_1;
    D/Unity ( 8866): tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);
    D/Unity ( 8866): mediump vec2 tmpvar_2;
    D/Unity ( 8866): highp vec4 tmpvar_3;
    D/Unity ( 8866): tmpvar_3.w = 1.0;
    D/Unity ( 8866): tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((
    D/Unity ( 8866): (_ZBufferParams.x * tmpvar_1.x)
    D/Unity ( 8866): + _ZBufferParams.y))));
    D/Unity ( 8866): highp vec4 tmpvar_4;
    D/Unity ( 8866): tmpvar_4 = (unity_CameraToWorld * tmpvar_3);
    D/Unity ( 8866): highp vec4 tmpvar_5;
    D/Unity ( 8866): tmpvar_5 = (_PreviousVP * tmpvar_4);
    D/Unity ( 8866): highp vec4 tmpvar_6;
    D/Unity ( 8866): tmpvar_6 = (_NonJitteredVP * tmpvar_4);
    D/Unity ( 8866): highp vec2 tmpvar_7;
    D/Unity ( 8866): tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);
    D/Unity ( 8866): highp vec2 tmpvar_8;
    D/Unity ( 8866): tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);
    D/Unity ( 8866): tmpvar_2 = (tmpvar_8 - tmpvar_7);
    D/Unity ( 8866): mediump vec4 tmpvar_9;
    D/Unity ( 8866): tmpvar_9.zw = vec2(0.0, 1.0);
    D/Unity ( 8866): tmpvar_9.xy = tmpvar_2;
    D/Unity ( 8866): gl_FragDepthEXT = tmpvar_1.x;
    D/Unity ( 8866): gl_FragData[0] = tmpvar_9;
    D/Unity ( 8866): }
    D/Unity ( 8866): fragment evaluation shader
    D/Unity ( 8866): #version 100
    D/Unity ( 8866): #extension GL_EXT_frag_depth : enable
    D/Unity ( 8866): precision highp float;
    D/Unity ( 8866): uniform highp vec4 _ProjectionParams;
    D/Unity ( 8866): uniform highp vec4 _ZBufferParams;
    D/Unity ( 8866): uniform highp mat4 unity_CameraToWorld;
    D/Unity ( 8866): uniform highp mat4 _NonJitteredVP;
    D/Unity ( 8866): uniform highp mat4 _PreviousVP;
    D/Unity ( 8866): uniform highp sampler2D _CameraDepthTexture;
    D/Unity ( 8866): varying highp vec2 xlv_TEXCOORD0;
    D/Unity ( 8866): varying highp vec3 xlv_TEXCOORD1;
    D/Unity ( 8866): void main ()
    D/Unity ( 8866): {
    D/Unity ( 8866): highp vec4 tmpvar_1;
    D/Unity ( 8866): tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);
    D/Unity ( 8866): mediump vec2 tmpvar_2;
    D/Unity ( 8866): highp vec4 tmpvar_3;
    D/Unity ( 8866): tmpvar_3.w = 1.0;
    D/Unity ( 8866): tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((
    D/Unity ( 8866): (_ZBufferParams.x * tmpvar_1.x)
    D/Unity ( 8866): + _ZBufferParams.y))));
    D/Unity ( 8866): highp vec4 tmpvar_4;
    D/Unity ( 8866): tmpvar_4 = (unity_CameraToWorld * tmpvar_3);
    D/Unity ( 8866): highp vec4 tmpvar_5;
    D/Unity ( 8866): tmpvar_5 = (_PreviousVP * tmpvar_4);
    D/Unity ( 8866): highp vec4 tmpvar_6;
    D/Unity ( 8866): tmpvar_6 = (_NonJitteredVP * tmpvar_4);
    D/Unity ( 8866): highp vec2 tmpvar_7;
    D/Unity ( 8866): tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);
    D/Unity ( 8866): highp vec2 tmpvar_8;
    D/Unity ( 8866): tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);
    D/Unity ( 8866): tmpvar_2 = (tmpvar_8 - tmpvar_7);
    D/Unity ( 8866): mediump vec4 tmpvar_9;
    D/Unity ( 8866): tmpvar_9.zw = vec2(0.0, 1.0);
    D/Unity ( 8866): tmpvar_9.xy = tmpvar_2;
    D/Unity ( 8866): gl_FragDepthEXT = tmpvar_1.x;
    D/Unity ( 8866): gl_FragData[0] = tmpvar_9;
    D/Unity ( 8866): }
    D/Unity ( 8866): fragment evaluation shader
    E/Unity ( 8866): Unable to find gvr
    I/ActivityManager( 475): Start proc com.asus.filemanager for broadcast com.asus.filemanager/.receiver.UpgradeBroadcastReceiver: pid=8987 uid=10023 gids={50023, 9997, 1028, 1015, 3003, 1023} abi=x86
    I/ActivityManager( 475): Killing 7566:com.google.android.talk/u0a74 (adj 15): empty #17
    I/Unity ( 8866): GVR Unity SDK Version: 1.60.0
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/ActivityManager( 475): Start proc com.android.musicfx for broadcast com.android.musicfx/.Compatibility$Receiver: pid=9014 uid=10027 gids={50027, 9997, 3003, 3002} abi=x86
    I/ActivityManager( 475): Killing 8466:com.asus.splendid/u0a43 (adj 15): empty #17
    I/Unity ( 8866): Null GVR context pointer, could not get GVR user prefs' handedness
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/Unity ( 8866): Initializing Daydream controller API.
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/ActivityManager( 475): Start proc com.android.keychain for broadcast com.android.keychain/.KeyChainBroadcastReceiver: pid=9034 uid=1000 gids={41000, 9997, 3002, 3003, 1028, 1015, 3001, 1023} abi=x86
    I/ActivityManager( 475): Killing 7118:com.asus.microfilm/u0a14 (adj 15): empty #17
    I/Unity ( 8866): DllNotFoundException: gvr
    I/Unity ( 8866): at (wrapper managed-to-native) Gvr.Internal.AndroidNativeControllerProvider:gvr_controller_get_default_options ()
    I/Unity ( 8866): at Gvr.Internal.AndroidNativeControllerProvider..ctor () [0x00000] in <filename unknown>:0
    I/Unity ( 8866): at Gvr.Internal.ControllerProviderFactory.CreateControllerProvider (.GvrController owner) [0x00000] in <filename unknown>:0
    I/Unity ( 8866): at GvrController.Awake () [0x00000] in <filename unknown>:0
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: Line: -1)
    I/Unity ( 8866):
    I/Unity ( 8866): NullReferenceException: (null)
    I/Unity ( 8866): at (wrapper managed-to-native) UnityEngine.MonoBehaviour:StopCoroutineViaEnumerator_Auto (System.Collections.IEnumerator)
    I/Unity ( 8866): at UnityEngine.MonoBehaviour.StopCoroutine (IEnumerator routine) [0x00000] in <filename unknown>:0
    I/Unity ( 8866): at GvrController.OnDisable () [0x00000] in <filename unknown>:0
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: Line: -1)
    I/Unity ( 8866):
    I/Unity ( 8866): Null GVR context pointer, could not get GVR user prefs' handedness
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/Unity ( 8866): Null GVR context pointer, could not get GVR user prefs' handedness
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/Unity ( 8866): Null GVR context pointer, could not get GVR user prefs' handedness
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/Unity ( 8866): Destroying GVR API structures.
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    I/ActivityManager( 475): Killing 8521:com.asus.UpdateLauncher/1000 (adj 15): empty #17
    I/Unity ( 8866): Null GVR context pointer, could not get viewer platform type
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    E/Unity ( 8866): Loaded device was '', must be one of 'daydream' or 'cardboard'
    E/Unity ( 8866):
    E/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    E/Unity ( 8866):
    I/Unity ( 8866): Null GVR context pointer, could not get GVR user prefs' handedness
    I/Unity ( 8866):
    I/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity ( 8866):
    E/Unity ( 8866): DaydreamApi.Create failed to instantiate object
    E/Unity ( 8866):
    E/Unity ( 8866): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    E/Unity ( 8866):
     
  6. DHein

    DHein

    Joined:
    Jan 26, 2016
    Posts:
    38
    oh I just realized that you are only targeting cardboard. In this case you don't really need the GVR sdk. As far as I know the only real reason you'd need the GVR "plugin" in 5.6.2 is for the daydream controller support.
    Is there a reason you want to use the non-native GVR?

    Could you post the adb log when building a simple scene (without GVR prefabs and with cardboard as the first VR device?

    Alternatively you could try using Unity 5.6.1, I tested the gvr SDK for that version today and it seemed to work for me.

    EDIT: have you installed the cardboard app on your smartphones?
     
    Last edited: Jul 3, 2017
  7. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
    Thank you for your answers and for your help Acctubi.
    I tried VR on my Asus Zenfone 2 with this app https://play.google.com/store/apps/details?id=com.Chibig.VRFantasy and work fine.
    Here logs of a simple scene, where cardboard is the only device. In the scene I have a cube with this script attached:

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.VR;
    6.  
    7. public class Test : MonoBehaviour
    8. {
    9.     void Start ()
    10.     {
    11.         Debug.Log("VR enabled: " + VRSettings.enabled);
    12.  
    13.         for (int i = 0; i < VRSettings.supportedDevices.Length; i++)
    14.         {
    15.             Debug.Log("Supported device [" + i + "]: " + VRSettings.supportedDevices [i]);
    16.         }
    17.  
    18.         StartCoroutine(LoadDevice(VRSettings.supportedDevices [0]));
    19.     }
    20.    
    21.     void Update ()
    22.     {
    23.         Debug.Log("VR enabled: " + VRSettings.enabled);
    24.     }
    25.  
    26.     IEnumerator LoadDevice (string device)
    27.     {
    28.         VRSettings.LoadDeviceByName(device);
    29.         yield return null;
    30.         VRSettings.enabled = true;
    31.     }
    32. }
    33.  

    Here the logs, the problem is always Unable to find gvr, and VRSettings.enabled is always false:


    V/ActivityManager( 630): Display changed displayId=0
    V/ActivityManager( 630): Displayed ActivityRecord{2a59d90d u0 com.lauracaponeeditore.testvr/com.unity3d.player.UnityPlayerActivity t3188} Resume. Not First Launch.
    I/ActivityManager( 630): Start proc com.asus.splendid for broadcast com.asus.splendid/.AsusSplendidReceiver: pid=28673 uid=10023 gids={50023, 9997, 3003, 1028} abi=x86
    I/ActivityManager( 630): Config changes=480 {0 1.0 222mcc10mnc it_IT ldltr sw360dp w640dp h335dp 480dpi nrml long land finger -keyb/v/h -nav/h s.139}
    V/ActivityManager( 630): Display changed displayId=0
    E/Unity (27990): Unable to find AudioPluginOculusSpatializer
    E/Unity (27990): Unable to find libaudioplugingvrunity
    E/Unity (27990): Unable to find libAudioPluginOculusSpatializer
    I/ActivityManager( 630): Displayed com.lauracaponeeditore.testvr/com.unity3d.player.UnityPlayerActivity: +250ms
    I/ActivityManager( 630): Killing 27859:com.asus.kidslauncher/u0a16 (adj 15): empty #17
    D/Unity (27990): GL_EXT_blend_minmax GL_EXT_color_buffer_float GL_EXT_discard_framebuffer GL_EXT_draw_buffers GL_EXT_multi_draw_arrays GL_EXT_multisampled_render_to_texture GL_EXT_occlusion_query_boolean GL_EXT_read_format_bgra
    GL_EXT_robustness GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_sRGB_decode GL_IMG_multi
    sampled_render_to_texture GL_IMG_program_binary GL_IMG_read_format GL_IMG_shader_binary GL_IMG_texture_compression_pvrtc GL_IMG_texture_compression_pvrtc2 GL_IMG_texture_format_BGRA8888 GL_IMG_texture_npot GL_KHR_blend_equation_ad
    vanced GL_KHR_blend_equation_advanced_coherent GL_KHR_debug GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_depth_texture GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_element_index_uint GL_OES_fragme
    nt_precision_high GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_required_internalformat GL
    D/Unity (27990): _OES_rgb8_rgba8 GL_OES_shader_image_atomic GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_npot GL_OES_texture_stencil8 GL_OES_texture_storage
    _multisample_2d_array GL_OES_vertex_array_object GL_OES_vertex_half_float
    D/ActivityManager( 630): cleanUpApplicationRecord -- 27859
    I/ActivityManager( 630): Start proc com.ironsource.appcloud.oobe.asus for service com.ironsource.appcloud.oobe.asus/io.ironsourceatom.sdk.FlushDatabaseService: pid=28736 uid=10094 gids={50094, 9997, 3003} abi=x86
    E/Unity (27990): Unable to find gvr
    I/Unity (27990): GVR Unity SDK Version: 1.60.0
    I/Unity (27990):
    I/Unity (27990): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (27990):
    I/Unity (27990): VR enabled: False
    I/Unity (27990):
    I/Unity (27990): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (27990):
    I/Unity (27990): Supported device [0]: cardboard
    I/Unity (27990):
    I/Unity (27990): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (27990):
    I/Unity (27990): VR enabled: False
    I/Unity (27990):
    I/Unity (27990): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (27990):
    I/Unity (27990): VR enabled: False
    I/Unity (27990):
    I/Unity (27990): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (27990):
    I/Unity (27990): VR enabled: False
    I/Unity (27990):
    I/Unity (27990): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (27990):
    I/Unity (27990): VR enabled: False
    I/Unity (27990):
     
  8. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
    You are right Acctube! There is no reason to use GVR plugin for my pourposes!
    I created a new project and just enabled Support VR, without import GoogleVRForUnity package, added cardboard device, build and run and all work fine on my Zenfone! I have stereoscopic view and camera rotate as device tilt.

    Thank you very much! I made my first VR project! :)

    But why new project with Google plugin doesn't work???
     
  9. xslipstream

    xslipstream

    Joined:
    Feb 3, 2017
    Posts:
    17
    Damn... this still doesn't work for me. I created a new project, switched to android platform, switched to VR Support -> Cardboard -> build & run. Still have no control over view or camera rotation
     
  10. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
  11. xslipstream

    xslipstream

    Joined:
    Feb 3, 2017
    Posts:
    17
    just installed patch 5.6.2.p1 and tried again... didn't work. =(
     
  12. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    What device? Is it an intel or arm based device?
     
  13. xslipstream

    xslipstream

    Joined:
    Feb 3, 2017
    Posts:
    17
  14. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Sorry got mixed up with the previous poster who posted the error list, which is something separate than what you're seeing. He was having larger issues than camera rotation.

    That being said in mobile VR on any of the Unity supported native integrations the sdk (HMD) has full control over the camera transform and this happens after LateUpdate() so you have no way to override. If you want to move the position or rotation you'll have to create a parent to the camera and move that. If you try to do it to the camera directly all will seem well in the editor, but when you deploy to device Unity will ignore you.
     
  15. xslipstream

    xslipstream

    Joined:
    Feb 3, 2017
    Posts:
    17
  16. xslipstream

    xslipstream

    Joined:
    Feb 3, 2017
    Posts:
    17
    I ran a logcat

    adb logcat -s Unity

     
  17. mariobuonocore1

    mariobuonocore1

    Joined:
    Mar 15, 2016
    Posts:
    21
    Yes @xslipstream I have ndk installed.
    I run this filter for logcat:

    adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG

    Try to see if you have some errors, and try to create a parent of your Main Camera as @greggtwep16 wrote and try to move or rotate that parent.
     
  18. rooskie

    rooskie

    Joined:
    Jun 3, 2015
    Posts:
    20
    I've been having same issue with ASUS Zenfone 2 on Unity 2017.3.0b7 without Installing Google VR SDK and just relying on native Unity VR. The app just wouldn't go into VR mode and I've been getting the error Unable to find gvr. It was obvious that the problem was related to Zenfone 2 processor (Intel) because app was working as expected on other devices. After digging around I found that Unity just doesn't include the x86 support for VR by default (Maybe if you select Windows Build Support when you install via Unity Download Assistant it does?). After poking around in the project's Temp folder I found out that the android-libraries/gvr/libs only has armeabi-v7a folder and not x86.

    Here is a small guide on how to fix it if you run into same problem:

    By default Unity comes without support VR for x86 phones.

    1. download latest SDK from here (look for the file with name that contains "base"): https://github.com/googlevr/gvr-android-sdk/tree/master/libraries

    2. Copy this file somewhere and unzip it's contents either with Archive Utility or cl:
    $ unzip sdk-base-v***.aar -d sdk-base

    3. Copy and unzip the gvr.aar file located in /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/VR :
    $ unzip gvr.aar -d gvr

    4. Copy the folder jni/x86 from folder sdk-base unzipped in step 2 into gvr/jni folder that was unzipped in step 3.

    5. Create new gvr.aar file
    $ jar cvf gvr.aar -C gvr/ .

    note the " ." at the end

    5. Copy the created gvr.aar file back to /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/VR
     
    Last edited: Nov 4, 2017
    DHein likes this.
  19. Nabeel-Ahmed

    Nabeel-Ahmed

    Joined:
    Nov 1, 2017
    Posts:
    3
     
  20. Nabeel-Ahmed

    Nabeel-Ahmed

    Joined:
    Nov 1, 2017
    Posts:
    3
    I was also facing this problem but finally this issue resolves. Thank God !
    Follow this link it will help alot:


    This tutorial will provide google cardboard SDK which support for unity 5.6