-
Notifications
You must be signed in to change notification settings - Fork 24k
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! |
downgrade to react-native 0.74 while waiting on: facebook/react-native#44437
* feat: support apple privacy manifest for compliance with Apple privacy requirements * chore: downgrade example to react-native 0.74 while waiting on: facebook/react-native#44437
@david-cahill Likely next week. We have been busy working on the React Conf the past two weeks, so we could not dedicate any time to anything else, unfortunately. This week we have internal events plus the AppJS conf that are going to slow down the releases a bit. Next week we should be back to normal. |
I am seeing the same error, and this has not been fixed by the linked PRs, so here is another one for this specific issue (manifest without a |
I wanted to go to the App JS conference (2 hours by car) but the company refused my request :( |
For me this did the fix:
|
so .. this was an issue for the react-native-maps project as well, it seems like by updating to react-native 0.74.1 from react-native 0.74.0 there are more strict checks for privacy manifest file content, ie both NSPrivacyCollectedDataTypes and NSPrivacyAccessedAPITypes were needed. we included both and pod install is now working as expected. so I'm not sure if this is really a bug in react-native itself or simply a better PrivacyPolicy file is expected |
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: