Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude PrivacyInfo.xcprivacy from Copy Bundle Resources #1459

Closed
arisupriatna14 opened this issue Mar 14, 2024 · 11 comments · Fixed by #1464
Closed

Exclude PrivacyInfo.xcprivacy from Copy Bundle Resources #1459

arisupriatna14 opened this issue Mar 14, 2024 · 11 comments · Fixed by #1464

Comments

@arisupriatna14
Copy link

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.

@arisupriatna14
Copy link
Author

UP!

@yonaskolb
Copy link
Owner

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

"xctestplan": FileType(buildPhase: BuildPhaseSpec.none),

@nhelke
Copy link

nhelke commented Apr 8, 2024

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.

@DeclanMcPartlin
Copy link

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

@yonaskolb
Copy link
Owner

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?

@pixlwave
Copy link

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

@yonaskolb
Copy link
Owner

This has been reverted and released as 2.40.1 👍

@yonaskolb
Copy link
Owner

@arisupriatna14 back to your original question, do you have multiple targets referencing the same privacy file?

@nhelke
Copy link

nhelke commented Apr 10, 2024

@arisupriatna14 or a single target referencing multiple privacy manifests?

@psykologist90
Copy link

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

@mcomisso
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants