I am trying to build an Android VR app/game using Unity Game Engine. I use Unity 2019.3.4f1. The new Google Cardboard XR plugin does not seem to work. I am not even able to run the 'HelloCardboard' scene from the Samples package in the editor. This is the error that I keep getting when I try:
DllNotFoundException: cardboard_api Google.XR.Cardboard.Api.HasDeviceParams () (at Library/PackageCache/com.google.xr.cardboard@8979e065b7/Runtime/Api.cs:101)
The generated APK too doesn't work on Mobile Device. The app starts and displays a black screen and nothing else.
Also, when I try to use the deprecated GVR SDK (Google VR SDK for Unity), I get another error message while building APK:
More than one file was found with OS independent path 'lib/armeabi-v7a/libgvr_audio.so
The app/game runs fine in the Unity Editor with the GVR SDK even though it is deprecated. But I am unable to build the APK file.
I don't know what is supposed to be done to resolve these errors. Is this a fault with the SDKs or is there something else that I should have done in order to make this work? Please help.
There are a few things you can try if you're having trouble building a Google VR app for Android in Unity:
Make sure that you have the latest version of Unity and the Google VR package installed. You can download the latest version of Unity from the official website and the Google VR package from the Unity Asset Store.
Check that your Unity project is set up correctly for building a Google VR app. In the Build Settings window, make sure that "Virtual Reality Supported" is checked and that "Android" is selected as the target platform.
If you're using a specific version of the Android SDK or NDK, make sure that you have it installed and that it is properly configured in Unity. You can do this by going to the "External Tools" section in the Preferences window.
Make sure that you have the correct version of the Android Build Support package installed. You can check which version is required by going to the "Project Settings > Player" window and looking at the "Minimum API Level" field. You can then install the required version of the Android Build Support package from the Unity Hub.
If you're still having trouble building the app, try cleaning your project by going to "Assets > Play Services Resolver > Android Resolver > Force Resolve" and then clicking the "Clean" button. This can often resolve issues with missing or outdated dependencies.