Exclude PrivacyInfo.xcprivacy from Copy Bundle Resources
arisupriatna14 opened this issue · comments
How to exclude PrivacyInfo.xcprivacy
from Copy Bundle Resource
? Cause, when generate the project.yml is automatically the added into Copy Bundle Resource
and error occurred when build.
Error Detail
Multiple commands produce '/Users/xxxx/Library/Developer/Xcode/DerivedData/xxx-ajimjnjhhtgfrughlwdbsrgcefjx/Build/Products/Debug-iphonesimulator/MyApp.app/PrivacyInfo.xcprivacy'
I'm trying to exclude the file like this:
sources:
- path: Application/Supporting Files
excludes:
- "**/*.xcprivacy"
but is that exclude from project not for Copy Bundle Resource
.
Is there a way to exclude the PrivacyInfo file from the Copy Bundle Resource?
Thanks in advance.
UP!
It's possible to add this to a preceding path with an includes
that sets a custom build phase, but the easiest way is to set a project wide file default
options:
fileTypes:
xcprivacy:
buildPhase: none
I'll open this issue back up though as a marker for someone to open a one line PR to add this as an XcodeGen default here
XcodeGen/Sources/ProjectSpec/FileType.swift
Line 122 in 9df3e62
I'm confused, because my reading of Apple's privacy manifest docs, specifically the first 'Note', is that they must be a target resource.
I get no error with a project with a single xcprivacy file which is in the copy resources build phase using Xcode 15.3 (Build version 15E204a) and Xcodegen 2.39.1:
CpResource /Users/<redacted>/Library/Developer/Xcode/DerivedData/<redacted>/Build/Products/Debug-iphoneos/<App>.app/PrivacyInfo.xcprivacy /Users/<redacted>/<Projects>/<Project>/<App>/PrivacyInfo.xcprivacy (in target '<App>' from project '<Project>')
cd /Users/<redacted>/<Projects>/<Project>
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/<redacted>/<Projects>/<Project>/<App>/PrivacyInfo.xcprivacy /Users/<redacted>/Library/Developer/Xcode/DerivedData/<redacted>/Build/Products/Debug-iphoneos/<App>.app
And I'm concerned that this change is going to start suppressing the privacy manifests which may cause app rejections starting 1 May.
For those of us who were relying on the previous default behaviour, adding this to options:
got us back to the previous behaviour:
fileTypes:
xcprivacy:
buildPhase: resources
Sounds like changing this default was perhaps an error. I will make a hotfix later today.
Can anyone else confirm the correct handling of this file, for assurance?
We just started seeing warnings from ASC that we're now missing the privacy manifest after upgrading to the latest XcodeGen. If it helps: our setup is separate manifests, one for each bundle which was working perfectly before this change - https://github.com/element-hq/element-x-ios
This has been reverted and released as 2.40.1 👍
@arisupriatna14 back to your original question, do you have multiple targets referencing the same privacy file?
@arisupriatna14 or a single target referencing multiple privacy manifests?
Hi, I don't know if can be related, but we're not being able to link the xcprivacy file to the targets.
We've the file created in the root folder, at the same level as the plist
Our latest build is failing as well:
error: Multiple commands produce '/Users/[REDACTED]/Library/Developer/Xcode/DerivedData/redacted-gdlfekfxlrxrfhbnavwhuygpgppu/Build/Intermediates.noindex/ArchiveIntermediates/redacted/InstallationBuildProductsLocation/Applications/redacted.app/PrivacyInfo.xcprivacy'
We have one xcprivacy for multiple targets. The targets are using the same folders, and they are released on different stores depending on what's on each xcconfig.