Skip to content

Priavacy Policy aggregation errors on empty dict #44401

Description

@johnf

Description

pod update will failed when it tries to aggregate a privacy policy with an empty dict. For example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPEplist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plistversion="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
</dict>
</plist>

I came across this in https://github.com/TimOliver/TOCropViewController which is a dependency of https://github.com/ivpusic/react-native-image-crop-picker

Steps to reproduce

  1. yarn add react-native-image-crop-picker
  2. cd ios
  3. pod update

React Native Version

0.74.1

Affected Platforms

Build - MacOS

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: Linux 6.8 Ubuntu 23.10 23.10 (Mantic Minotaur)
CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor
Memory: 9.27 GB / 30.50 GB
Shell:
version: 5.2.15
path: /bin/bash
Binaries:
Node:
version: 20.11.1
path: ~/.nvm/versions/node/v20.11.1/bin/node
Yarn:
version: 1.22.22
path: ~/work/gladly/mobile/node_modules/.bin/yarn
npm:
version: 10.7.0
path: ~/work/gladly/mobile/node_modules/.bin/npm
Watchman:
version: 4.9.0
path: /usr/bin/watchman
SDKs:
Android SDK:
API Levels:
- "31"
- "32"
- "33"
- "34"
Build Tools:
- 28.0.3
- 29.0.2
- 29.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 31.0.0
- 32.1.0
- 33.0.0
- 33.0.0
- 33.0.1
- 34.0.0
- 34.0.0
- 35.0.0
System Images:
- android-31 | Intel x86_64 Atom
- android-31 | Google APIs Intel x86_64 Atom
- android-33 | Google APIs Intel x86_64 Atom
- android-33 | Google Play Intel x86 Atom_64
- android-34 | Google Play Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10811636
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 3.1.2
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Stacktrace or Logs

[!] An error occurred while processing the post-install hook of the Podfile.
no implicit conversion of nil into Array
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:121:in `+'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:121:in `block (5 levels) in get_used_required_reason_apis'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in `each'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in `block (4 levels) in get_used_required_reason_apis'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `each'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `block (3 levels) in get_used_required_reason_apis'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:105:in `each'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:105:in `block (2 levels) in get_used_required_reason_apis'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:104:in `each'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:104:in `block in get_used_required_reason_apis'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:102:in `each'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:102:in `get_used_required_reason_apis'
/Users/johnf/mobile/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:18:in `add_aggregated_privacy_manifest'
/Users/johnf/mobile/node_modules/react-native/scripts/react_native_pods.rb:301:in `react_native_post_install'
/Users/johnf/mobile/packages/mobile/ios/Podfile:51:in `block (3 levels) in from_ruby'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-core-1.14.3/lib/cocoapods-core/podfile.rb:196:in `post_install!'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1013:in `run_podfile_post_install_hook'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:149:in `message'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:307:in `generate_pods_project'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:183:in `integrate'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:170:in `install!'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/command/update.rb:63:in `run'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in `run'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/gems/cocoapods-1.14.3/bin/pod:55:in `<top (required)>'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/bin/pod:25:in `load'
/Users/johnf/mobile/packages/mobile/vendor/bundle/ruby/3.3.0/bin/pod:25:in `<top (required)>'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/cli/exec.rb:58:in `load'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/cli/exec.rb:23:in `run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/cli.rb:451:in `exec'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/cli.rb:34:in `dispatch'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/cli.rb:28:in `start'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/exe/bundle:28:in `block in <top (required)>'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/exe/bundle:20:in `<top (required)>'
/opt/homebrew/opt/ruby/bin/bundle:25:in `load'
/opt/homebrew/opt/ruby/bin/bundle:25:in `<main>'

Reproducer

https://github.com/johnf/rn-priacy-policy-aggregation-bug

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions