Not all the targets have a defined symbol_type (#45591)

Summary:
Errors occurred on running `pod install`:

```
[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `symbol_type' for #<Xcodeproj::Project::Object::PBXAggregateTarget:0x000000010f6ea568>

[redact]/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:53:in `block in get_application_targets'
```

## Changelog:

[iOS] [Fixed] - Fix error on handling privacy manifest

Pull Request resolved: https://github.com/facebook/react-native/pull/45591

Reviewed By: cipolleschi

Differential Revision: D60107607

Pulled By: dmytrorykun

fbshipit-source-id: 316220fe54174b18c9b61775f807d5d05d9f0240
This commit is contained in:
CHEN Xian-an
2024-07-29 10:21:19 +02:00
committed by Thibault Malbranche
parent 1835245e9e
commit b9f7005c46
@@ -50,7 +50,7 @@ module PrivacyManifestUtils
end
def self.get_application_targets(user_project)
return user_project.targets.filter { |t| t.symbol_type == :application }
return user_project.targets.filter { |t| t.respond_to?(:symbol_type) && t.symbol_type == :application }
end
def self.read_privacyinfo_file(file_path)