I am attempting to integrate the Cesium for Unity package into the Unity PolySpatial template project and build to Apple Vision Pro. I’ve encountered multiple build errors throughout the process and have used suggestions on this board to make it a bit further, but I still haven’t managed to successfully build in Xcode yet. I’m using Unity 2022.3.19f1.
Initially Unity would show errors pertaining to the “Reinterop” class or namespace. A workaround suggested in this thread is to add the package locally rather than via scoped registry so that I can manually add UNITY_VISIONOS to all #IF UNITY_IOS preprocessor conditions. I also had to disable Burst compiling and optimizations in the Burst AOT Settings & check VisionOS on the iOS plugin libraries. This does result in an Xcode project, but attempting to build in Xcode presents its own errors, this time with undefined symbols. The majority of the errors seem to be with Cesium types or namespaces like CesiumGltf, CesiumUtility, Cesium3DTilesContent and similar, however there are also undefined symbols scoped under Fmt::v8::detail, Async::detail, and Spdlog. Here’s a gist with all the undefined symbol errors: CesiumForUnityVisionOSXcodeErrors.txt · GitHub
Has anyone else run into this issue when attempting to build to Apple Vision Pro? I know at least one other person has done it based on this thread but they didn’t mention any build issues. Also is official Vision Pro support planned for the plugin? Thanks in advance!
I can’t give you complete instructions, because I don’t have a Vision Pro and have never tried to build for it. However, one thing that is certain is that building for a new platform from the release package will not work. You need to clone the cesium-unity repo and build it from source. The basic process for doing so is described here, but it really only covers Windows:
Another useful resource is our GitHub Actions workflow, which shows how Cesium for Unity is built by our CI system for macOS and iOS:
A key part of that script is dotnet run --project Build~, which invokes this script:
And that script, in turn, runs Unity from the command-line several times in order to build the project, which ends up running functions from here inside Unity:
And, via Unity magic, parts of this are invoked during that process in order to build the native code: