Search Issue Tracker
Fixed in 2018.2.X
Fixed in 2017.1.X, 2017.2.X, 2017.3.X, 2018.1.X
Won't Fix in 5.6.X
Votes
6
Found in
2017.1.0p5
Issue ID
946104
Regression
Yes
[Android] Exception while initializing GoogleVR from Unity library using Gradle build system (Release build)
Steps to reproduce:
1) Open Unity and create a new project
2) Switch platform to Android in the Build settings
3) In the Player Settings, enable Virtual Reality Supported and add Cardboard SDK in to the list
4) Create a new Keystore
5) In the Build Settings, change Build system in to the Gradle(New)
6) Build and Run project on a device
Expected result: GoogleVR should be initialized without an exception.
Actual result: Exception while initializing GoogleVR from Unity library using non Development build :
Google VR Error []: Exception initializing GoogleVR from Unity library. Didn't find class "com.unity3d.unitygvr.GoogleVR" on path: DexPathList[[zip file "/data/app/com.Company.GradleFailVr-2/base.apk"],nativeLibraryDirectories=[/data/app/com.Company.GradleFailVr-2/lib/arm, /data/app/com.Company.GradleFailVr-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
09-06 10:16:56.519 31242 31242 E Unity : Unable to initialize Google VR subsystem.
09-06 10:16:56.531 31242 31242 E Unity : Google VR Error []: Exception initializing GoogleVR from Unity library. Didn't find class "com.unity3d.unitygvr.GoogleVR" on path: DexPathList[[zip file "/data/app/com.Company.GradleFailVr-2/base.apk"],nativeLibraryDirectories=[/data/app/com.Company.GradleFailVr-2/lib/arm, /data/app/com.Company.GradleFailVr-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
09-06 10:16:56.531 31242 31242 E Unity : Unable to initialize Google VR subsystem.
Reproduced with:
2017.1.0a3, 2017.1.0f1, 2017.1.1f1, 2017.2.0b10, 2017.3.0a7
Not reproduced with:
5.6.3p2. 2017.1.0a1
Regression since:
2017.1.0a2 or 2017.1.0a3 (application crash using Gradle build system in 2017.1.0a2 version of Unity)
Devices under testing:
Samsung SM G925F (Galaxy S6 Edge)*, OS:7.0, CPU:arm64-v8a, GPU:Mali-T760, Build:samsung/zeroltexx/zerolte:7.0/NRD90M/G925FXXU5EQFC:user/release-keys
Lge LG D855 (G3)*, OS:5.0, CPU:armeabi-v7a, GPU:Adreno (TM) 330, Build:lge/g3_global_com/g3:5.0/LRX21R.A1445306351/1445306351:user/release-keys
Note: Works as expected when Development build is enabled in the Build Settings
---------------------------------------------------------------------
Fixed in : 2017.1.3p2, 2017.2.1p4, 2017.3.1p1 , 2018.1.0b7, 2018.2.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Source Image property gets set to 'None' when using a specific Sprite and Play mode is entered
- Rendering locks up when not looking at a transparent material on Meta Quest 2
- Volumetrics break when using a Custom Pass to create a Thickness Buffer for Alpha Clipping
- All tests are run instead of only the failed ones when the "Rerun Failed" button is pressed
- GameObject is not masked when the "Render PostProcessing Effects" pass executes with a resolved non-MSAA Color target and MSAA DepthStencil target
tmendez
Aug 06, 2019 21:41
I was able to get around this by updating my Google VR Android package from the package manager, and also updating from the .unitypackage from the Google Vr Unity SDK https://github.com/googlevr/gvr-unity-sdk
vuplex
Nov 01, 2017 01:47
I also ran into this issue while configuring Proguard minification for my project in Unity 2017.2. I had added a my own Proguard rules to proguard-user.txt as specified by the docs (https://docs.unity3d.com/Manual/android-gradle-overview.html), and I resolved the missing class issue you described by adding the Unity and GVR rules to my proguard-user.txt:
## Unity Proguard
-keep class bitter.jnibridge.* { *; }
-keep class com.unity3d.** { *; }
-keep class org.fmod.* { *; }
## Google GVR SDK Proguard
# Don't obfuscate any NDK/SDK code. This makes the debugging of stack traces in
# in release builds easier.
-keepnames class com.google.vr.ndk.** { *; }
-keepnames class com.google.vr.sdk.** { *; }
# These are part of the Java <-> native interfaces for GVR.
-keepclasseswithmembernames,includedescriptorclasses class com.google.vr.** {
native <methods>;
}
-keep class com.google.vr.cardboard.UsedByNative
-keep @com.google.vr.cardboard.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.cardboard.UsedByNative *;
}
-keep class com.google.vr.cardboard.annotations.UsedByNative
-keep @com.google.vr.cardboard.annotations.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.cardboard.annotations.UsedByNative *;
}
-keep class com.google.vr.cardboard.annotations.UsedByReflection
-keep @com.google.vr.cardboard.annotations.UsedByReflection class *
-keepclassmembers class * {
@com.google.vr.cardboard.annotations.UsedByReflection *;
}
rrrus
Oct 27, 2017 20:12
Until Unity rolls out a proper fix for this, you can work around it by changing the Player Settings > Publishing Settings > Minify setting for Release to "None".
The crash is coming from Proguard obfuscating GVR class names so they are no longer accessible externally.