iosreact-nativeios-privacy-settingsprivacy-manifest

Multiple commands produce PrivacyInfo.xcprivacy


I am trying to build my app for iOS (using react-native), and I keep getting the error Multiple commands produce PrivacyInfo.xcprivacy.

I know where the error comes from, it's related to the fact that the Toast Pod has an PrivacyInfo.xcprivacy file:

Toast Pod

But I also have one for my app, because otherwise Apple won't accept my app starting 1st of May 2024.

They are colliding, because the files are named the same, but Apple's guidelines are strict in that sense, the file must be named this way, so I cannot rename mine.

My temporary solution has been to delete the Toast privacy file (not just removing the reference, deleting it), but I feel there has to be an actual solution for this (like a way to merge both files).

Has anyone encountered a similar problem?

Thanks


Solution

  • Finally, I found the solution.

    1. Open

    /Pods/Target Support Files/Pods-TargetName/Pods-TargetName-resources.sh

    search for PrivacyInfo.xcprivacy, and you can see which library incorrectly copied the PrivacyInfo.xcprivacy file to the main bundle.

    1. Then there are two ways:

    (1) Check if the library has a newer version. If it does, update it and try again. The issue may have been resolved in the new version.

    (2) If there is no newer version or the new version does not resolve the issue, download the source code directly. Modify the podspec file of this library and change

    "resources": "LibName/PrivacyInfo.xcprivacy"

    to

    "resource_bundles": {"LibName": "LibName/PrivacyInfo.xcprivacy"}

    (3) In your project's Podfile, change

    pod "LibName"

    to your local path, like

    pod "LibName", :path =>'Your Local Path'

    (4)run pod update and try again