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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

This did not help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.