After upgrading an existing Android game to Unity 5.6.1p3 with Google VR SDK 1.60, I now get an immediate crash “Unfortunately, app has stopped” message. I opened Android Studio and looked in the logcat window:
06-13 14:21:43.624 293-3659/? E/AudioPolicyManager: unknown stream type
06-13 14:21:43.624 293-3659/? E/AudioPolicyManager: unknown stream type
06-13 14:21:43.634 29546-29546/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.NealJonesGames.EarthAttack, PID: 29546
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.NealJonesGames.EarthAttack/com.google.unity.GoogleUnityActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.google.unity.GoogleUnityActivity” on path: DexPathList[[zip file “/data/app/com.NealJonesGames.EarthAttack-1/base.apk”],nativeLibraryDirectories=[/data/app/com.NealJonesGames.EarthAttack-1/lib/arm, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2322)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5696)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.google.unity.GoogleUnityActivity” on path: DexPathList[[zip file “/data/app/com.NealJonesGames.EarthAttack-1/base.apk”],nativeLibraryDirectories=[/data/app/com.NealJonesGames.EarthAttack-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1083)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2312)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5696)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Suppressed: java.lang.ClassNotFoundException: com.google.unity.GoogleUnityActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
… 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
06-13 14:21:43.634 649-1409/? E/ActivityManager: App crashed! Process: com.NealJonesGames.EarthAttack
06-13 14:21:43.634 649-1409/? W/ActivityManager: Force finishing activity com.NealJonesGames.EarthAttack/com.google.unity.GoogleUnityActivity
I’ve got the Google Cardboard app installed and I can see the link to the game in there okay, so I wonder what is missing? My settings are as follows:
- 32 bit display buffer is off
- Colour space is Gamma
- Auto Graphics API enabled
- Multithreaded rendering off
- Virtual reality SDKs are set to Cardboard (16-bit depth)
- Stereo rendering method is multi-pass
- Minimum API level set to 4.4 Kit-Kat (API level 19)
- Scripting backend is Mono2x
- Device filter is FAT (ARMv7 and x86)
- Stripping level disabled
I’ve tried a variety of combinations of the settings above but nothing seems to make a difference.
I am using the GoogleVR audio spatializer too, and there is something in the log about an “unknown stream type” but I have been using that spatializer previously without a problem.
Does anyone have any suggestions for me? Thank you in advance!