New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priavacy Policy aggregation errors on get_privacyinfo_file_path #44437
Comments
Mine patch file: diff --git a/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb b/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb
index 7600829..7fd3d61 100644
--- a/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb
+++ b/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb
@@ -21,6 +21,7 @@ module PrivacyManifestUtils
get_core_accessed_apis.each do |accessed_api|
api_type = accessed_api["NSPrivacyAccessedAPIType"]
reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
+ next if api_type.nil? || reasons.nil?
required_reason_apis[api_type] ||= []
required_reason_apis[api_type] += reasons
end
@@ -29,6 +30,7 @@ module PrivacyManifestUtils
(privacy_info["NSPrivacyAccessedAPITypes"] || []).each do |accessed_api|
api_type = accessed_api["NSPrivacyAccessedAPIType"]
reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
+ next if api_type.nil? || reasons.nil?
# Add reasons from existing PrivacyInfo file to the ones from pods
required_reason_apis[api_type] ||= []
required_reason_apis[api_type] += reasons
@@ -67,7 +69,7 @@ module PrivacyManifestUtils
end
def self.ensure_reference(file_path, user_project, target)
- reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref.path.end_with? "PrivacyInfo.xcprivacy" }
+ reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref.path&.end_with? "PrivacyInfo.xcprivacy" }
unless reference_exists
# We try to find the main group, but if it doesn't exist, we default to adding the file to the project root – both work
file_root = user_project.root_object.main_group.children.find { |group|
@@ -79,9 +81,11 @@ module PrivacyManifestUtils
end
def self.get_privacyinfo_file_path(user_project, targets)
+ puts "Debug: Entering get_privacyinfo_file_path function"
file_refs = targets.flat_map { |target| target.resources_build_phase.files_references }
- existing_file = file_refs.find { |file_ref| file_ref.path.end_with? "PrivacyInfo.xcprivacy" }
+ existing_file = file_refs.find { |file_ref| file_ref.path&.end_with? "PrivacyInfo.xcprivacy" }
if existing_file
+ puts "Debug: Found existing file: #{existing_file.real_path}"
return existing_file.real_path
end
@@ -90,9 +94,11 @@ module PrivacyManifestUtils
if info_plist_path.nil?
# return path that is sibling to .xcodeproj
path = user_project.path
- return File.join(File.dirname(path), "PrivacyInfo.xcprivacy")
+ puts "Debug: info_plist_path is nil, using user_project.path: #{path}"
+ return File.join(File.dirname(path), "PrivacyInfo.xcprivacy") unless path.nil?
end
- return File.join(File.dirname(info_plist_path.real_path),"PrivacyInfo.xcprivacy")
+ puts "Debug: Found info_plist_path: #{info_plist_path.real_path}"
+ return File.join(File.dirname(info_plist_path.real_path),"PrivacyInfo.xcprivacy") unless info_plist_path.real_path.nil?
end
def self.get_used_required_reason_apis(installer)
@@ -111,6 +117,7 @@ module PrivacyManifestUtils
accessed_api_types.each do |accessed_api|
api_type = accessed_api["NSPrivacyAccessedAPIType"]
reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
+ next if api_type.nil? || reasons.nil?
used_apis[api_type] ||= []
used_apis[api_type] += reasons
end
|
@aleqsio @cipolleschi can you look at this, please? :) |
Added repro repo :) |
I can confirm it's happening for me, latest Xcode and MacOs. |
Same for me although slightly different error:-
Reverting back to RN 0.74.0 and all is fine. I assume Apple will reject any submissions as we're past the 1st of May deadline for getting the privacy manifest sorted out and 0.74.0 wasn't merging these properly in the first place (from other 3rd party libs)? |
We have a fix ready with #44400. It has landed already in main, we need to release patched versions of React Native. I'll keep the issue open for discoverability. |
Hi @cipolleschi, |
I think we're looking to merge #44410 to fix this issue, no? |
Thank you for answer @aleqsio. I didn't notice this PR :( |
@cipolleschi Any idea when this might be released? Thanks! |
Description
When upgraded from RN 0.73.8 to RN 0.74.1 pod install gives error on
get_privacyinfo_file_path
Steps to reproduce
Update from RN 0.73.8 with PrivacyManifest to RN 0.74.1
React Native Version
0.74.1
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/lorenc-tomasz/rn-reproduction
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: