最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

xcode - Error when processing post install hook: undefined method `new_file' for #<Xcodeproj::Project::Object::PB

programmeradmin0浏览0评论

Whenever I run pod install on my React Native project I'm getting the following error:

An error occurred while processing the post-install hook of the Podfile.

undefined method `new_file' for #<Xcodeproj::Project::Object::PBXFileReference:0x0000000154ab6eb8>

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:74:in `ensure_reference'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:48:in `block in add_aggregated_privacy_manifest'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:47:in `each'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:47:in `add_aggregated_privacy_manifest'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/react_native_pods.rb:259:in `react_native_post_install'

/Users/AA/Downloads/F/F/ios/Podfile:67:in `block (3 levels) in from_ruby'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/podfile.rb:196:in `post_install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:1013:in `run_podfile_post_install_hook'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:149:in `message'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:315:in `create_and_save_projects'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:307:in `generate_pods_project'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:183:in `integrate'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:170:in `install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command/install.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/bin/pod:55:in `<top (required)>'

/usr/local/bin/pod:23:in `load'

/usr/local/bin/pod:23:in `<main>'

For further information, this is also the first time I'm running the project since updating to the latest Xcode iteration

I tried updating the react native version of the project, as well as the packages of the project, I was expecting that this would remedy the issue however it persists

I have also tried downgrading cocoapods

Whenever I run pod install on my React Native project I'm getting the following error:

An error occurred while processing the post-install hook of the Podfile.

undefined method `new_file' for #<Xcodeproj::Project::Object::PBXFileReference:0x0000000154ab6eb8>

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:74:in `ensure_reference'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:48:in `block in add_aggregated_privacy_manifest'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:47:in `each'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:47:in `add_aggregated_privacy_manifest'

/Users/AA/Downloads/F/F/node_modules/react-native/scripts/react_native_pods.rb:259:in `react_native_post_install'

/Users/AA/Downloads/F/F/ios/Podfile:67:in `block (3 levels) in from_ruby'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/podfile.rb:196:in `post_install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:1013:in `run_podfile_post_install_hook'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:149:in `message'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:315:in `create_and_save_projects'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:307:in `generate_pods_project'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:183:in `integrate'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:170:in `install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command/install.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/bin/pod:55:in `<top (required)>'

/usr/local/bin/pod:23:in `load'

/usr/local/bin/pod:23:in `<main>'

For further information, this is also the first time I'm running the project since updating to the latest Xcode iteration

I tried updating the react native version of the project, as well as the packages of the project, I was expecting that this would remedy the issue however it persists

I have also tried downgrading cocoapods

Share Improve this question edited Mar 4 at 12:57 Andrew1024 asked Mar 4 at 12:50 Andrew1024Andrew1024 1961 gold badge3 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

To fix this error, simply delete the entire node_modules folder and the ios/Pods folder, and then replace your entire Podfile with a default one from a brand-new React Native project.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论