Hello, friends,
I stumbled across a problem where my app builds ok in Unity, but when I try to build it in xcode it results in build error, stating SafariServices.h
is missing. I attached a screenshot of the error. Does anyone know how to resolve this? I have no idea how to proceed.
I have exactly the same problem, any update about this issue ?
This is some additional plugin depending on the SafariServices Framework. Frameworks arenât included automatically, they need to be linked explicitly. Where did you get this plugin and did you follow all the setup instructions?
Try enabling âSafariServicesâ under âFramework dependenciesâ on the plugin inspector of the âSafariView.mmâ file in Unity.
Thanks for your reply. Actually this error will happen when we add the Authentication Package from Unity (com.unity.services.authentication).
I tested it now on an empty project on unity 6, after the build to xcode, i see this error in Xcode.
I canât find the file âSafariView.mmâ in Unity
I donât think âSafariView.mmâ is coming from an official package. Those are usually in a âLibraries/com.unity.x/â subfolder.
Maybe itâs coming from another non-official package? Try to search in âLibrary/PackageCacheâ in your project.
Maybe also try a clean build into a new folder, to make sure itâs not something old remaining in the Xcode project?
Actually Iâve found it in the Packages folder but I canât change it. however I copied it to the assets folder, but i canât see the safari services in the inspector.
in Xcode, I see an error saying the the SafariServices are not available when building for tvOS !
So I think we are in stuck nowâŚ
What package is it?
You can embed packages to make them part of the project and editable.
Yeah, thereâs no Safari on tvOS. You should be able to exclude the plugin from tvOS instead. But whatever is using the plugin needs to have an alternative for tvOS that doesnât use Safari. E.g. for OAuth, youâd use code based authorization instead of web.
Iâve resolved the issue by removing the SafariView.mm file from the Libraries folder in the xCode project. It was located at â/Users/me/Documents/Unity Projects/mygame/Builds/AppleTV/Libraries/com.unity.services.authenticationâ.
Iâve built the project and the sign-in worked successfully (I tested it in the simulator).
Thanks a bunch, Adrian, for pointing out the cause of this bug!
As a refernece, I am using Unity 6 (6000.0.36) with the latest updated packages and the latest xCode (16.2) on Mac Sequoia 15.3