Skip to content

PrivacyInfo.xcprivacy is created at the root of the project causing conflicts #79

@Muha-coinmotion

Description

@Muha-coinmotion

Describe the bug
I have added PrivacyInfo.xcprivacy to our project target and added the file to the Copy Bundle Resources Phase in the Build Phase; after that, I can not build the app or create the Archive. I am getting the following error. I'm unsure, but your PrivacyInfo file should be in a bundle.

Changed the inclusion of PrivacyInfo.xcprivacy to resource_bundles for cocoapod to avoid resource name collision when the user uses cocoapod as static library.

error: Multiple commands produce 'Developer/Xcode/DerivedData/MyPorject/Build/Products/Release-iphonesimulator/myproject.app/PrivacyInfo.xcprivacy'
    note: Target 'myproject' (project 'project') has copy command from '/myproject/ios/PrivacyInfo.xcprivacy' to 'Developer/Xcode/DerivedData/MyProject/Build/Products/Release-iphonesimulator/myproject.app/PrivacyInfo.xcprivacy'
    note: That command depends on command in Target 'myproject' (project 'myproject'): script phase “[CP] Copy Pods Resources”

Project Root Level PrivacyInfo.xcprivacy contents

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>NSPrivacyAccessedAPITypes</key>
  <array>
    <dict>
      <key>NSPrivacyAccessedAPIType</key>
      <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
      <key>NSPrivacyAccessedAPITypeReasons</key>
      <array>
        <string>C617.1</string>
        <string>3B52.1</string>
      </array>
    </dict>
    <dict>
      <key>NSPrivacyAccessedAPIType</key>
      <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
      <key>NSPrivacyAccessedAPITypeReasons</key>
      <array>
        <string>E174.1</string>
        <string>7D9E.1</string>
      </array>
    </dict>
    <dict>
      <key>NSPrivacyAccessedAPIType</key>
      <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
      <key>NSPrivacyAccessedAPITypeReasons</key>
      <array>
        <string>CA92.1</string>
      </array>
    </dict>
    <dict>
      <key>NSPrivacyAccessedAPIType</key>
      <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
      <key>NSPrivacyAccessedAPITypeReasons</key>
      <array>
        <string>35F9.1</string>
      </array>
    </dict>
  </array>
</dict>
</plist>



To Reproduce
Steps to reproduce the behavior:

  1. Create PrivacyInfo.xcprivacy file in the project
  2. Build the app
  3. see error

Expected behavior
We should be able to add PrivacyInfo.xcprivacy file in the project and it should be at the root of the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions