Skip to content

fix(darwin): ship PrivacyInfo.xcprivacy as a real file for SwiftPM#373

Merged
wang-bin merged 1 commit into
wang-bin:masterfrom
abdelaziz-mahdy:fix/spm-darwin-privacy-symlink
Jun 28, 2026
Merged

fix(darwin): ship PrivacyInfo.xcprivacy as a real file for SwiftPM#373
wang-bin merged 1 commit into
wang-bin:masterfrom
abdelaziz-mahdy:fix/spm-darwin-privacy-symlink

Conversation

@abdelaziz-mahdy

Copy link
Copy Markdown
Contributor

Fixes #372.

darwin/fvp/Resources/PrivacyInfo.xcprivacy is a symlink to
../../PrivacyInfo.xcprivacy, which points outside the SwiftPM package root
(darwin/fvp). The target declares it as a resource via
.process("Resources/PrivacyInfo.xcprivacy").

When a host app builds with Swift Package Manager enabled, Flutter symlinks each
plugin package into <app>/macos/Flutter/ephemeral/Packages/.packages/<pkg>.
Xcode then resolves the escaping resource symlink relative to that symlinked
location and looks for the file at .packages/PrivacyInfo.xcprivacy
(= .packages/<pkg>/../PrivacyInfo.xcprivacy), which does not exist:

error: <app>/macos/Flutter/ephemeral/Packages/.packages/PrivacyInfo.xcprivacy: No such file or directory (in target 'fvp_fvp' from project 'fvp')
** BUILD FAILED **

so flutter build macos / ios fails for any app on SwiftPM. (The
Sources/fvp/* symlinks compile fine — Xcode follows symlinks for compile
inputs; only the .process resource-copy phase breaks on the escaping link.)

Fix

Ship the manifest as a real file inside the package, matching the pattern
first-party plugins use (e.g. connectivity_plus keeps a real
PrivacyInfo.xcprivacy under Sources/<target>/). The CocoaPods path is
unchanged — the podspec still references darwin/PrivacyInfo.xcprivacy.

Verified

flutter build macos (Flutter 3.44.2, Xcode 26.5, SwiftPM enabled) now
completes and packages successfully; CocoaPods builds remain unaffected.

darwin/fvp/Resources/PrivacyInfo.xcprivacy was a symlink to
../../PrivacyInfo.xcprivacy, which points outside the SwiftPM package
root (darwin/fvp). When a host app builds with Swift Package Manager,
Flutter symlinks each plugin package into
<app>/macos/Flutter/ephemeral/Packages/.packages/<pkg>. Xcode then
resolves the resource's escaping symlink relative to that symlinked
package location and looks for it at .packages/PrivacyInfo.xcprivacy,
which does not exist:

  error: .../ephemeral/Packages/.packages/PrivacyInfo.xcprivacy:
  No such file or directory (in target 'fvp_fvp' from project 'fvp')

so `flutter build macos`/`ios` fails for any app using SwiftPM.

Source files under Sources/fvp are also symlinks but compile fine,
because Xcode follows symlinks for compile inputs; only the .process
resource copy phase breaks on the escaping link.

Replace the symlink with a real copy of the manifest (the same pattern
every first-party plugin uses, e.g. connectivity_plus ships a real
PrivacyInfo.xcprivacy inside Sources/<target>). The CocoaPods path is
unaffected: the podspec still references darwin/PrivacyInfo.xcprivacy.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces a relative reference to PrivacyInfo.xcprivacy with a newly created, standard Apple privacy manifest file at darwin/fvp/Resources/PrivacyInfo.xcprivacy. The new manifest defines empty arrays for tracking domains, accessed API types, and collected data types, and sets tracking to false. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@wang-bin wang-bin merged commit 032b969 into wang-bin:master Jun 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter build macos/ios fails under Swift Package Manager: darwin PrivacyInfo.xcprivacy symlink escapes the package root

2 participants