Skip to main content

Swift Package Targets Require a Development Team

Unity: All versions | Platform: iOS | Dependencies: Swift Package Manager

Issue Description

Archiving the Xcode project fails right after the clean step, with one error per Swift package that ships resources:

error: Signing for "Firebase_FirebaseRemoteConfig" requires a development team.
Select a development team in the Signing & Capabilities editor.
(in target 'Firebase_FirebaseRemoteConfig' from project 'Firebase')

A regular Build & Run never shows this, because resource bundles are only signed during archive and export.

Swift Package Manager creates a separate Xcode project for every package, and a <PackageName>_<TargetName> target for every target that ships resources. Those targets have no development team of their own and take it from the main project. When the main project has none, signing fails.

Solution

Set the signing team in Unity: Project Settings → Player → iOS → Identification → Signing Team ID. Unity writes it into the exported Xcode project, and the Swift Package targets inherit it.

Unity Build Automation

Unity Build Automation removes this setting from the exported project and passes only the signing identity to xcodebuild, so filling in the Team ID does not help there. Supply the team on the command line instead, through a custom Gymfile:

xcargs("-UseModernBuildSystem=YES CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM=<TEAM_ID>")

Keep -UseModernBuildSystem=YES. Unity Build Automation passes it by default, and defining xcargs replaces the whole value.

Save the Gymfile next to a config.json:

{
"gymfile": "path/to/your/Gymfile"
}

Then set Build target → Edit → Edit Advanced Options → Platform specific settings (iOS) → Custom Fastlane Configuration Path to that config.json. This is configured per build target, so each target needs its own path.

note

Unity is aware of the issue and describes this as a temporary workaround. See Swift Packages and Automatic Signing.