Comments (18)
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
from react-native.
@aleqsio @cipolleschi can you look at this, please? :)
from react-native.
@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.
from react-native.
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.
from react-native.
I think we're looking to merge #44410 to fix this issue, no?
from react-native.
I can confirm it's happening for me, latest Xcode and MacOs.
from react-native.
Same for me although slightly different error:-
[Privacy Manifest Aggregation] Appending aggregated reasons to existing PrivacyInfo.xcprivacy file. [Privacy Manifest Aggregation] Reading .xcprivacy files to aggregate all used Required Reason APIs. [!] An error occurred while processing the post-install hook of the Podfile. undefined method 'each' for nil:NilClass /Users/x/Development/x/mobile_v3/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in 'block (4 levels) in get_used_required_reason_apis' /Users/x/Development/x/mobile_v3/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in 'each'
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)?
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 NSPrivacyAccessedAPITypes
key): #44628
from react-native.
Added repro repo :)
from react-native.
Same for me although slightly different error:-
[Privacy Manifest Aggregation] Appending aggregated reasons to existing PrivacyInfo.xcprivacy file.
[Privacy Manifest Aggregation] Reading .xcprivacy files to aggregate all used Required Reason APIs.
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method 'each' for nil:NilClass
/Users/x/Development/x/mobile_v3/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in 'block (4 levels) in get_used_required_reason_apis'
/Users/x/Development/x/mobile_v3/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in 'each'
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)?
from react-native.
Hi @cipolleschi,
44400 closes issue with Dic
. The mentioned issue here is connected with get_privacyinfo_file_path
and I have no idea why file_refs doesn't have a path property.
from react-native.
Thank you for answer @aleqsio. I didn't notice this PR :(
from react-native.
@cipolleschi Any idea when this might be released? Thanks!
from react-native.
@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 wanted to go to the App JS conference (2 hours by car) but the company refused my request :(
from react-native.
For me this did the fix:
next if accessed_api_types.nil? || accessed_api_types.nil?
from react-native.
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
from react-native.
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
thanks @lorenc-tomasz patch also worked for me
from react-native.
Version 0.74.2 of React Native is out with all the fixes to the privacy manifest. Patches for versions 0.73 and 0.72 will come in the next few days with similar fixes!
from react-native.
Thanks @cipolleschi, I updated and it's all good!
from react-native.
Related Issues (20)
- cocoapods: undefined method `end_with?' for nil:NilClass HOT 1
- [iOS] Static counters lead to data races
- [Bridgeless] Multiple bundles loaded on android when locale changed natively HOT 1
- FBReactNativeSpec/FBReactNativeSpec.h: No such file or directory (in target 'React-Codegen' from project 'Pods') HOT 6
- Unable to run the app on Android 14. HOT 7
- Cannot Make API call to http endpoint when using formData[Tried with both fetch and axios] HOT 3
- 'If-None-Match' and 'If-Modified-Since' Headers being Appended to Outgoing Network DELETE Requests Resulting in Server 501 Error
- Undefined symbol: _OBJC_CLASS_$_RCTRootView - Linker command failed with exit code 1 (use -v to see invocation)
- React native downloading react-android-0.74.1-debug.aar again and again wtih so slow speed HOT 3
- Modai from "react-native" crashes the App in iOS. Works fine in android HOT 2
- react-native-xcode.sh doesn't filter out link local addresses correctly HOT 5
- Reloading a dev app rapidly crashes the app HOT 11
- Last FlatList item component re-mounted when adding new elements at the beginning of the list
- Installing hermes-engine (0.74.1) HOT 1
- On Android horizontal Animated.ScrollView, animated children with a transform: translate are not pressable correctly HOT 3
- Packaging failure HOT 2
- Wrong orientation width and height values on iPad only, HOT 4
- React native webview image download without external storage permission HOT 2
- Is it possible to use have an Android library as the native module of a React Native project? HOT 14
- Calling JS callback asynchronously from C++ thread. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.