CloudXR SDK with Unity

I am trying to create Android App for Oculus Quest2 with CloudXR SDK and unityLibrary which is exported as a library for Android.

When I launch application, it throws me an error as:

JNI DETECTED ERROR IN APPLICATION: JNI GetStaticMethodID called with pending exception java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "vrapi_UpdateFoveation" referenced by "/data/app/com.nvidia.cloudxr.ovr-63zV9gHGa5kcOiDbIcKtww==/lib/arm/"
at void java.lang.Runtime.loadLibrary0(java.lang.ClassLoader, java.lang.Class, java.lang.String) (
at void java.lang.Runtime.loadLibrary0(java.lang.Class, java.lang.String) (
at void java.lang.System.loadLibrary(java.lang.String) (
at void com.unity.oculus.OculusUnity.loadLibrary(java.lang.String) (
at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.Class) (
at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader) (
at void java.lang.Runtime.load0(java.lang.Class, java.lang.String) (
at void java.lang.System.load(java.lang.String) (
at boolean com.unity3d.player.UnityPlayer.nativeRender() ((null):-2)
at boolean com.unity3d.player.UnityPlayer.access$300(com.unity3d.player.UnityPlayer) ((null):-1)
at boolean com.unity3d.player.UnityPlayer$e$1.handleMessage(android.os.Message) ((null):-1)
at void android.os.Handler.dispatchMessage(android.os.Message) (
at void android.os.Looper.loop() (
at void com.unity3d.player.UnityPlayer$ ((null):-1)

  in call to GetStaticMethodID
  from java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.Class)

How can I solve this issue??

Thank you for your cooperation.


this is because the resulting APK does not contain the file, to solve this you need to modify the build.gradle from your app’s module and from the unity module as follows:

Unity buil.gradle:
change implementation (name: ‘. OVRPlugin.aar’, ext:‘aar’) for compileOnly files(‘libs/OVRPlugin.aar’)

and in the app’s build.gradle add this line implementation files(‘path-to-unity-build/unityLibrary/libs/OVRPlugin.aar’)

Within Android Studio you can analyze any APK, AAR file, use that tool to ensure the build artifact contains all the required files.

Be aware that you might have incompatibilities due to the different Oculus SDK versions (native vs Unity), also you can not run the Unity player in the same process as the CloudXR client.