Google VR had a fatal issue while loading

I got this error when I try to run a simple unity app with XR/VR settings enabled and cardboard on android (Galaxy S7).

Google VR Error [Cardboard]: Google VR had a fatal issue while loading. VR will not be available

logcat details:

01-19 09:38:21.213 1574 6611 I ActivityManager: Start proc 11240:com.google.vr.vrcore/u0a221 for content provider com.google.vr.vrcore/.settings.VrSettingsProvider
01-19 09:38:21.247 1574 3947 I ActivityManager: DSS on for com.google.vr.vrcore and scale is 1.0
01-19 09:38:21.348 1574 4057 W ActivityManager: Permission Denial: opening provider com.google.android.gsf.gservices.GservicesProvider from ProcessRecord{93dee0c 11240:com.google.vr.vrcore/u0a221} (pid=11240, uid=10221) requires com.google.android.providers.gsf.permission.READ_GSERVICES or com.google.android.providers.gsf.permission.WRITE_GSERVICES
01-19 09:38:21.350 1574 3918 W ActivityManager: Permission Denial: opening provider com.google.android.gsf.gservices.GservicesProvider from ProcessRecord{93dee0c 11240:com.google.vr.vrcore/u0a221} (pid=11240, uid=10221) requires com.google.android.providers.gsf.permission.READ_GSERVICES or com.google.android.providers.gsf.permission.WRITE_GSERVICES
01-19 09:38:21.365 1574 6613 W ActivityManager: Permission Denial: opening provider com.google.android.gsf.gservices.GservicesProvider from ProcessRecord{93dee0c 11240:com.google.vr.vrcore/u0a221} (pid=11240, uid=10221) requires com.google.android.providers.gsf.permission.READ_GSERVICES or com.google.android.providers.gsf.permission.WRITE_GSERVICES
01-19 09:38:21.366 11178 11178 E Unity : Error trying to call delegated method load. null
01-19 09:38:21.366 11178 11178 E Unity : Google VR Error [Cardboard]: Exception caught while loading GoogleVR. Attempt to invoke virtual method ‘long java.lang.Long.longValue()’ on a null object reference
01-19 09:38:21.366 11178 11201 E Unity : Google VR Error [Cardboard]: Google VR had a fatal issue while loading. VR will not be available.
01-19 09:38:21.377 11178 11178 E Unity : Error trying to call delegated method unload. null
01-19 09:38:21.389 11178 11178 E Unity : Error trying to call delegated method load. null
01-19 09:38:21.389 11178 11178 E Unity : Google VR Error [Cardboard]: Exception caught while loading GoogleVR. Attempt to invoke virtual method ‘long java.lang.Long.longValue()’ on a null object reference
01-19 09:38:21.390 11178 11201 E Unity : Google VR Error [Cardboard]: Google VR had a fatal issue while loading. VR will not be available.
01-19 09:38:21.391 11178 11178 E Unity : Error trying to call delegated method unload. null

I believe the fixed versions of Unity are documented here:
https://forum.unity.com/threads/for-people-targeting-cardboard-on-android-please-update-your-google-vr-sdk-to-1-12-or-later.520986/

In the mean time, you should be able to include the latest Google VR SDK for Unity (currently 1.130.1) in your project to get the Google VR SDK integration working again.

The Google VR SDK for Unity includes its own updated gvr.aar that should fix this issue (https://docs.unity3d.com/Manual/VRDevices-GoogleVR.html documents how this overrides the Unity builtin version of this library).

Just had the same issue, did you find a solution?

It turns out that my problem though very similar may have slightly different cause. The logcat output I was getting was:

GvrLayoutFactory: Dynamic library loading disabled, using built-in GvrLayout implementation.
No implementation found for boolean com.google.vr.ndk.base.GvrApi.nativeUsingShimLibrary() (tried Java_com_google_vr_ndk_base_GvrApi_nativeUsingShimLibrary and Java_com_google_vr_ndk_base_GvrApi_nativeUsingShimLibrary__)
Error trying to call delegated method load. null
Google VR Error [Cardboard]: Exception caught while loading GoogleVR. Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
Google VR Error [Cardboard]: Google VR had a fatal issue while loading. VR will not be available.
Error trying to call delegated method unload. null
WindowManager: Relayout Window{3518c0fd0 u0 com.focalpointvr.avprotest/com.unity3d.player.UnityPlayerActivity}: viewVisibility=0 req=1440x2560 WM.LayoutParams{(0,0)(fillxfill) sim=#20 ty=1 fl=#1810580 pfl=0x20000 fmt=-3 vsysui=0x1706 needsMenuKey=2 naviIconColor=0}
GvrLayoutFactory: Dynamic library loading disabled, using built-in GvrLayout implementation.
No implementation found for boolean com.google.vr.ndk.base.GvrApi.nativeUsingShimLibrary() (tried Java_com_google_vr_ndk_base_GvrApi_nativeUsingShimLibrary and Java_com_google_vr_ndk_base_GvrApi_nativeUsingShimLibrary__)
Error trying to call delegated method load. null
Google VR Error [Cardboard]: Exception caught while loading GoogleVR. Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
Google VR Error [Cardboard]: Google VR had a fatal issue while loading. VR will not be available.
Error trying to call delegated method unload. null

As it was working fine in the last few days I tried a whole bunch of things to step back in time (older Android SDK, Older code, Older Unity etc), and eventually discovered that it worked fine on Unity 2017.3.0p1 but not in p2 or p3. So something changed in p2 that produced my error.

I reported this as a bug: https://fogbugz.unity3d.com/default.asp?991127_jhl7ggsi3gon4ip4 and it has been reproduced by the QA team. Doesn’t appear it’s fixed in 2017.3.0p4 though I haven’t retested yet.

Good luck with yours.

Jules

Same issue on 2017.3.1p1 and 2017.2.1p4 and 2017.1.3p1 - Cardboard devices are entirely broken, but Daydream devices are fine…