Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the Archive does not contain any "PrivacyInfo.xcprivacy" files

What steps to take to resolve following error related to missing PrivacyInfo:

The archive does not contain any "PrivacyInfo.xcprivacy" files.

This happens when I try to Generate Privacy Report on the archive.

Steps taken to define Privacy Manifest and debug this error:

  • Defined the PrivacyInfo.xcprivacy and ensured it loading correctly in the Xcode 15 beta 5.
  • Added PrivacyInfo.xcprivacy to same location as Info.plist - Screenshot added below:
  • Ensured the target membership of PrivacyInfo.xcprivacy to frameworks.
  • Archive the framework and also use command line to create distribution .xcframework - receiving the error with archive and unable to see .xcprivacy file in the .xcframework (next question).

Will this PrivacyInfo.xcprivacy file be locatable in the archive or final .xcframework content on the same level as Info.plist? If yes, where to find it?

For reference, Apple Developer - Privacy manifest files, doesn't mention any other specific steps for Framework. Here is the WWDC-2023 video: WWDC-2023 Privacy Menifest, which illustrates various steps.

Location of PrivacyInfo

Privacy-Info-XCPrivacy-file-location

Debugging

Details of debugging with Xcode 15 Beta 8 & with 15 (RC)

Note: The current SDK project has two targets - RestSDK.framework and RestAPI.framework. This could be interfering with inclusion of Privacy Manifest (PrivacyInfo.xcprivacy).

In order to narrow down the issue, took following debugging steps:

  1. Installed latest beta 8 Version 15.0 beta 8 (15A5229m)
  2. Removed old xcprivacy file and added a new with Command-n -> Resource -> App Privacy. Removed all entires but 1 in the new Privacy Manifest and added NSPrivacyTracking as false. Here is how it looks:
<dict>
    <key>NSPrivacyTracking</key>
    <false/>
    <key>NSPrivacyCollectedDataTypes</key>
    <array>
        <dict>
            <key>NSPrivacyCollectedDataType</key>
            <string>NSPrivacyCollectedDataTypeUserID</string>
            <key>NSPrivacyCollectedDataTypeLinked</key>
            <true/>
            <key>NSPrivacyCollectedDataTypeTracking</key>
            <false/>
            <key>NSPrivacyCollectedDataTypePurposes</key>
            <array>
                <string>NSPrivacyCollectedDataTypePurposeProductPersonalization</string>
            </array>
        </dict>
    </array>
</dict
  1. Add the target membership to both RestSDK.framework & RestAPI.framework (first test), and run the command to create archive: Noticed following log on console for RestAPI.framework.
Copying /Users/***/Library/Developer/Xcode/DerivedData/RestSDK-ezfmhpxprnhniqcyumuohtkeojih/Build/Intermediates.noindex/ArchiveIntermediates/RestSDK/InstallationBuildProductsLocation/Library/Frameworks/RestAPI.framework/PrivacyInfo.xcprivacy

and not a similar log for RestSDK.framework.

  1. Removed the RestAPI.framework target membership of PrivacyInfo.xcprivacy. Keeping target membership only for RestSDK.framework. Triggered the archive build with command line and noticed following:
Copying /Users/***/Library/Developer/Xcode/DerivedData/RestSDK-ezfmhpxprnhniqcyumuohtkeojih/Build/Intermediates.noindex/ArchiveIntermediates/RestSDK/InstallationBuildProductsLocation/Library/Frameworks/RestSDK.framework/PrivacyInfo.xcprivacy
  1. Tried Generate Privacy Report and still the same result: The archive does not contain any PrivacyInfo.xcprivacy files.. Even though, RestSDK.framework under iOS.xcarchive contains PrivacyInfo.xcprivacy ?!! XCPrivacy file in built SDK archive
  2. [Stuck] - Perhaps, I need to add some other keys.
like image 832
ashokds Avatar asked Oct 12 '25 11:10

ashokds


2 Answers

Not sure if you have already tried this, but the PrivacyInfo.xcprivacy file may not be set as a BundleResource.

You can right-click on the PrivacyInfo.xcprivacy file and select "Build Action" and set it to BundleResource. Alternatively, you can add this property inside <ItemGroups> in your Xamarin.iOS project file: <BundleResource Include="PrivacyInfo.xcprivacy" />

After doing this, build and archive, you should be able to generate the privacy report.

like image 87
Arun H Avatar answered Oct 14 '25 02:10

Arun H


By default PrivacyInfo.xcprivacy file is not added to any target. So you need to click on the file, open the Inspectors-menu at the far right in Xcode, and select a Target Membership for the file. Probably just your main target in this case :)

like image 29
Nicolai Harbo Avatar answered Oct 14 '25 00:10

Nicolai Harbo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!