Xcode Project Build Fails After 0.4.3 com.unity.xr.visionos

After upgrading to com.unity.xr.visionos package version 0.4.3, Unity successfully produces an Xcode project but the project build fails with the error below.

com.unity.xr.visionos/Runtime/VisionOSNativeBridge.mm:63:5: error: use of undeclared identifier 'ar_session_set_data_provider_state_change_handler'; did you mean 'ar_session_set_data_provider_state_change_handler_with_queue'?
    ar_session_set_data_provider_state_change_handler(session, nullptr, ^(ar_data_providers_t data_providers,
In file included from /Users/ryandawson/Dev/VRProject/Builds/VisionOS/VRProject/Libraries/ARM64/Packages/com.unity.xr.visionos/Runtime/VisionOSNativeBridge.mm:2:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/XRSimulator.platform/Developer/SDKs/XRSimulator1.0.sdk/System/Library/Frameworks/ARKit.framework/Headers/hand_tracking.h:14:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/XRSimulator.platform/Developer/SDKs/XRSimulator1.0.sdk/System/Library/Frameworks/ARKit.framework/Headers/session.h:67:16: note: 'ar_session_set_data_provider_state_change_handler_with_queue' declared here
AR_EXTERN void ar_session_set_data_provider_state_change_handler_with_queue(

Letting Xcode fix the issue by replacing the ar_session_set_data_provider_state_change_handler with an ar_session_set_data_provider_state_change_handler_with_queue does allow the build to progress, but it fails to link with the following errors:

Undefined symbol: _ar_hand_anchor_get_hand_skeleton
Undefined symbol: _ar_hand_skeleton_get_joint_named
Undefined symbol: _ar_skeleton_joint_get_anchor_from_joint_transform
Undefined symbol: _ar_skeleton_joint_is_tracked

How can I resolve these issues and get my project building again?

This is a VR project using the built-in render pipeline with AR Foundation package 5.0.7. Possibly of note, the XR Hand package is not in this project.

I just upgraded to 0.5.0, embedded the package, fixed the resource used to set the UNITY_HAS_URP define, and the produced Xcode project has the same issue.

I had a similar issue caused by using an old version of the simulator. Removing (unmounting?) the old simulators fixed it. Not sure if your issue is the same.

I have upgraded my project to Unity 2022.3.12f1 and I am still using com.unity.xr.visionos package version 0.5.0 embedded with fixes for the UNITY_HAS_URP define and the incorrect ar_session_set_data_provider_state_change_handler call in VisionOSNativeBridge.mm. With this setup I am able to build targeting the Simulator SDK and the Xcode project successfully builds and runs in the Simulator. However, if I build targeting the Device SDK the Xcode project build fails with the undefined symbols error as mentioned above.

Undefined symbol: _ar_hand_anchor_get_hand_skeleton
Undefined symbol: _ar_hand_skeleton_get_joint_named
Undefined symbol: _ar_skeleton_joint_get_anchor_from_joint_transform
Undefined symbol: _ar_skeleton_joint_is_tracked

How can I resolve this issue and once again be able to deploy to a device?

To validate the error and see if there is just a typo, I checked the exports of libUnityVisionOS.a and it appears that there is no hand tracking binary linked into the library at all so none of the requested entry points are found. Seems like a corrected package is needed for this issue; unless there is a workaround that can be applied to the package.

After determining that an AVP VR updated Unity 3D Core template project was able to build successfully without issue I fiddled for too long of a time trying to figure out the project difference to find the issue. In the end I ended up deleting my Library folder and reimporting the project then builds magically worked again. No idea how I got into this bad state. :frowning: At least I am past the issue now.

1 Like