While building Unity may fail the build with the error: Error: More than one file was found with OS independent path 'lib/arm64-v8a/'.


This is caused by Snapdragon Spaces and another plugin both dynamically linking to the library. 

Affected Versions of Snapdragon Spaces SDK

This bug has been fixed with Snapdragon Spaces 0.19.1.

Previous versions are still affected, and it is recommended to update the SDK when encountering this error.


For Unity resolve this by: 

  • Delete either one of the libc++shared files. It is recommended to delete the .so file of the other plugin over the Snapdragon Spaces one. The libc++_shared of Snapdragon Spaces is located in the package at UnityPackage\com.qualcomm.snapdragon.spaces-[spaces version].tgz\com.qualcomm.snapdragon.spaces-0.16.1.tgz\package\Runtime\Core\Android\libopenxr_loader.aar\jni\arm64-v8a\ within the libopenxr_loader.aar file. 
  • Modify the Custom Launcher Gradle Template:
    1. Enable Custom Launcher Gradle Template the Project Settings.
    2. This generates a launcherTemplate.gradle file under [Project Folder] > Plugins > Android.
    3. Add the lines to launcherTemplate.gradle:
      packagingOptions {

Note that, while this will usually fix the issue, there can be potential version incompatibilities when the version is different between the Snapdragon Spaces and other plugin.

Upcoming versions of Snapdragon Spaces will link this library statically to avoid conflicts with plugins by 3rd-parties.