When exporting a project to Android Studio (you can check with the example project), Android Studio can't find GoogleUnityActivity in the manifest, changing it to UnityPlayerActivity tries to start the app but it closes immediately.
The correct manifest (or at least the one you should start with before editing) is in Assets/Plugins/Android. It appears that Unity uses it when building from the editor but not when exporting to AS. We'll have to add that to the online SDK docs.
I've tried, but that manifest uses GoogleUnityActivity too so there's been no more luck. Changing it to UnityPlayerActivity gives this error:
xception getting class com.google.vr.platform.unity.UnityVrActivityListener: UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.google.vr.platform.unity.UnityVrActivityListener
java.lang.ClassNotFoundException: com.google.vr.platform.unity.UnityVrActivityListener
I still have a copy of the old SDK and that one still works properly.
The manifest is supposed to use GoogleUnityActivity. The C# code expects it. It appears that the Android Studio project doesn't link to the .aar's that are in our SDK. GoogleUnityActivity is in unityvractivity.aar.
Try this (I'm saying all my steps just in case):
Now it works! Thank you so much for your help :)
hello smdol, where can I know how to use GoogleUnityActivity ? just a normal activity inherit this one?
Hi @smdol, what sdk version was this with? I've recently faced this issue and I'm using v1.20.0
Most helpful comment
Try this (I'm saying all my steps just in case):