GVR 1.30 built with Unity 5.6.0f3 not working on iOS device

I recently moved over to the latest version of Unity 5.6.0f3 Personal & I am using GVR SDK for Unity v1.30.

I am building the app with Xcode 8.3.1

VR mode works when running in the editor in Unity on my Mac but when I deploy it to my iPhone 6 the app does not switch into VR mode or show the UI prompting me to use a cardboard with my phone. This did work before!

Here is the console debug (edited):

PlayerConnection initialized from /var/containers/Bundle/Application/869167A8-750D-4289-8696-890097ED1C8F/P5.app/Data (debug = 0)

PlayerConnection initialized network socket : 0.0.0.0 55000

Multi-casting “[IP] 192.168.1.67 [Port] 55000 [Flags] 2 [Guid] 3807396288 [EditorId] 500297824 [Version] 1048832 [Id] iPhonePlayer(Manjits-iPhone):56000 [Debug] 0” to [225.0.0.222:54997]…

Started listening to [0.0.0.0:55000]

Player data archive not found at /var/containers/Bundle/Application/869167A8-750D-4289-8696-890097ED1C8F/P5.app/Data/data.unity3d, using local filesystem2017-04-10 22:21:23.649458-0700 P5[1371:349362] Metal GPU Frame Capture Enabled

2017-04-10 22:21:23.650690-0700 P5[1371:349362] Metal API Validation Disabled
2017-04-10 22:21:23.726936-0700 P5[1371:349362] libMobileGestalt MobileGestaltSupport.m:153: pid 1371 (P5) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-04-10 22:21:23.727091-0700 P5[1371:349362] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see rdar://problem/11744455)

[ERROR]native : unity.cc:182 Resume: Start() has not been called!
[ERROR]native : unity.cc:182 Resume: Start() has not been called!

→ applicationDidBecomeActive()

Renderer: Apple A9 GPU
Vendor: Apple Inc.
Version: OpenGL ES 2.0 Metal - 39.9
GLES: 2

GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_r

ead_format GL_IMG_texture_compression_pvrtc

OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level <OpenGL ES 2.0> ; Context handle 1946315552

Initialize engine version: 5.6.0f3 (497a0f351392)

-------- Shader compilation failed
#version 100
#extension GL_EXT_frag_depth : enable
precision highp float;
uniform highp vec4 _ProjectionParams;
uniform highp vec4 _ZBufferParams;
uniform highp mat4 unity_CameraToWorld;
uniform highp mat4 _NonJitteredVP;
uniform highp mat4 _PreviousVP;
uniform highp sampler2D _CameraDepthTexture;
varying highp vec2 xlv_TEXCOORD0;
varying highp vec3 xlv_TEXCOORD1;

void main ()
{
highp vec4 tmpvar_1;
tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);
mediump vec2 tmpvar_2;
highp vec4 tmpvar_3;
tmpvar_3.w = 1.0;
tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((

(_ZBufferParams.x * tmpvar_1.x)

  • _ZBufferParams.y))));

highp vec4 tmpvar_4;
tmpvar_4 = (unity_CameraToWorld * tmpvar_3);
highp vec4 tmpvar_5;
tmpvar_5 = (_PreviousVP * tmpvar_4);
highp vec4 tmpvar_6;
tmpvar_6 = (_NonJitteredVP * tmpvar_4);
highp vec2 tmpvar_7;

tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);
highp vec2 tmpvar_8;
tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);
tmpvar_2 = (tmpvar_8 - tmpvar_7);
mediump vec4 tmpvar_9;
tmpvar_9.zw = vec2(0.0, 1.0);
tmpvar_9.xy = tmpvar_2;
gl_FragDepthEXT = tmpvar_1.x;
gl_FragData[0] = tmpvar_9;
}

-------- failed compiling:

fragment evaluation shader
WARNING: 0:4: extension ‘GL_EXT_frag_depth’ is not supported
ERROR: 0:38: Use of undeclared identifier ‘gl_FragDepthEXT’

Note: Creation of internal variant of shader ‘Hidden/Internal-MotionVectors’ failed.
WARNING: Shader Unsupported: ‘Hidden/Internal-MotionVectors’ - Pass ‘’ has no vertex shader
WARNING: Shader Unsupported: ‘Hidden/Internal-MotionVectors’ - Setting to default shader.
WARNING: Shader Unsupported: ‘Hidden/VR/BlitCopyFromTexArray’ - Pass ‘’ has no vertex shader
WARNING: Shader Unsupported: ‘Hidden/VR/BlitCopyFromTexArray’ - Setting to default shader.

[ERROR]native : unity.cc:182 Resume: Start() has not been called!
[ERROR]native : unity.cc:182 Resume: Start() has not been called!

UnloadTime: 4.116250 ms
GVR Unity SDK Version: 1.30
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[ ])
UnityEngine.Debug:LogException(Exception)
UnityEngine.Logger:Log(LogType, Object)
System.Collections.ObjectModel.Collection`1:Remove(T)
UnityEngine.Debug:Log(Object)
GvrUnitySdkVersion:LogGvrUnitySdkVersion()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
2017-04-10 22:21:26.977473-0700 P5[1371:349362] INFO [vr/gvr/capi/src/gvr.cc:109] Initialized GVR version 1.30.0

→ applicationWillResignActive()

Ok, the plot thickens.

When I build the same project with Unity 5.6.0b6 (this is the experimental build with the timeline editor) the app build works on the iOS device. When I loaded the project into this version of Unity, it did changes some scripts around related to the GVR SDK.

So something has changed in Unity 5.6.0f3?

Does the shader compiler still throw an error? Do you know what unity.cc is (i.e. is it something on your end?)

Good point, I will check how the debug output differs. I should add originally that I was letting the app default to using Metal & the problem was occurring using the Metal renderer as well.

There is no shader compile error in the debug output:

2017-04-11 12:31:36.113065-0700 scenery[1499:433009] [DYMTLInitPlatform] platform initialization successful

2017-04-11 12:31:36.188969-0700 scenery[1499:432892] → registered mono modules 0x1012fff10

2017-04-11 12:31:36.248390-0700 scenery[1499:432892] You’ve implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add “remote-notification” to the list of your supported UIBackgroundModes in your Info.plist.

→ applicationDidFinishLaunching()

2017-04-11 12:31:36.312224-0700 scenery[1499:432892] Metal GPU Frame Capture Enabled

2017-04-11 12:31:36.312483-0700 scenery[1499:432892] Metal API Validation Disabled

2017-04-11 12:31:36.374606-0700 scenery[1499:432892] libMobileGestalt MobileGestaltSupport.m:153: pid 1499 (scenery) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled

2017-04-11 12:31:36.374710-0700 scenery[1499:432892] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see rdar://problem/11744455)

[ERROR]native : unity.cc:182 Resume: Start() has not been called!
[ERROR]native : unity.cc:182 Resume: Start() has not been called!
→ applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A9 GPU
Initialize engine version: 5.6.0b6 (d6790b8476db)
WARNING: Shader Unsupported: ‘Hidden/VideoDecodeGLSL’ - Pass ‘FLIP_RGBARECT_TO_RGBA’ has no vertex shader
WARNING: Shader Unsupported: ‘Hidden/VideoDecodeGLSL’ - Setting to default shader.
[ERROR]native : unity.cc:182 Resume: Start() has not been called!
[ERROR]native : unity.cc:182 Resume: Start() has not been called!
UnloadTime: 1.390916 ms
GVR Unity SDK Version: 1.30
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
2017-04-11 12:31:40.318924-0700 scenery[1499:432892] INFO [vr/gvr/capi/src/gvr.cc:109] Initialized GVR version 1.30.0

Built-in distortion correction disabled. Causes: [Requires OpenGL]
GvrViewer:InitDevice()
GvrViewer:Awake()

Oops. I made a mess with doing some edits.

If I build the app without including a custom package for the GVR SDK and enable VR in the player settings & select cardboard as the VR device, the iOS app will start-up & go into VR mode. this is with Unity 5.6.0f3.

2017-04-11 12:49:20.760105-0700 ProductName[1517:436736] Metal GPU Frame Capture Enabled

2017-04-11 12:49:20.760478-0700 ProductName[1517:436736] Metal API Validation Disabled
2017-04-11 12:49:20.816093-0700 ProductName[1517:436736] libMobileGestalt MobileGestaltSupport.m:153: pid 1517 (ProductName) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-04-11 12:49:20.816204-0700 ProductName[1517:436736] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see rdar://problem/11744455)

→ applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A9 GPU
Initialize engine version: 5.6.0f3 (497a0f351392)

2017-04-11 12:49:22.811143-0700 ProductName[1517:436736] INFO [vr/gvr/capi/src/gvr.cc:108] Initialized GVR version 1.20.0
UnloadTime: 3.539541 ms
Setting up 1 worker threads for Enlighten.
Thread → id: 16f48b000 → priority: 1

Google VR SDK 1.30 is not compatible with native iOS starting with Unity 5.6 release versions. You need to wait 1.40. Until then there are a few working hacks you can find in GVR Github issues:

Thanks!

GVR SDK v 1.40 is out & I was able to build my project using Unity 5.6p1 with Xcode 8.3.2.

The additional factor after the build output was created by Unity, I needed to update the podfile spec to use GVR SDK 1.40 and update the pods.

But my app crashes when I load a new scene from the menu scene running in VR mode and loading another scene still in VR mode.

I need to turn off VR mode while scene switching

using UnityEngine.VR;

public void OnPointerClick () {
VRSettings.enabled = false;
SceneManager.LoadScene(“scene_name”);
}

Thanks to this post here: