skip to Main Content

I am getting the below error in fresh react-native installation and when trying to do pod install.

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

undefined method `__apply_Xcode_12_5_M1_post_install_workaround' for #<Pod::Podfile:0x00000001068fad98 @defined_in_file=#<Pathname:/Users/fullmad/Projects/saga-reserve/sagaMobile/ios/Podfile>, @internal_hash={}, @root_target_definitions=[#<Pod::Podfile::TargetDefinition label=Pods>], @current_target_definition=#<Pod::Podfile::TargetDefinition label=Pods>, @post_install_callback=#<Proc:0x000000012a01a6a0 /Users/fullmad/Projects/saga-reserve/sagaMobile/ios/Podfile:26>, @installation_options=#<Pod::Installer::InstallationOptions:0x00000001068b6148 @clean=true, @deduplicate_targets=true, @deterministic_uuids=true, @integrate_targets=true, @lock_pod_sources=true, @warn_for_multiple_pod_sources=true, @warn_for_unused_master_specs_repo=true, @share_schemes_for_development_pods=false, @disable_input_output_paths=false, @preserve_pod_file_structure=false, @generate_multiple_pod_projects=false, @incremental_installation=false, @skip_pods_project_generation=false>>

/Users/fullmad/Projects/saga-reserve/sagaMobile/ios/Podfile:28:in `block (3 levels) in from_ruby'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/podfile.rb:196:in `post_install!'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:945:in `run_podfile_post_install_hook'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:933:in `block in run_podfile_post_install_hooks'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:149:in `message'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:932:in `run_podfile_post_install_hooks'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:331:in `block (2 levels) in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:330:in `block in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:309:in `create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:301:in `generate_pods_project'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:180:in `integrate'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:167:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'

3

Answers


  1. If You don’t use M1 based computer to build, You can comment "__apply_Xcode_12_5_M1_post_install_workaround(installer)" line in Your Podfile.

    Login or Signup to reply.
  2. Check ios/Podfile syntax and that our __apply_Xcode_12_5_M1_post_install_workaround Ruby method’s defined (might be worth rm -rf node_modules && yarn in case)

    __apply_Xcode_12_5_M1_post_install_workaround

    # node_modules/react-native/scripts/react_native_pods.rb
    
    # ...
    
    def __apply_Xcode_12_5_M1_post_install_workaround(installer)
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
          end
      end
    
      `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
    end
    

    Here’s a minimal template to check out the Podfile

    Login or Signup to reply.
  3. If you are using M1 based computer, you can still comment "__apply_Xcode_12_5_M1_post_install_workaround(installer)" line in your Podfile and run the command arch -x86_64 pod install instead of pod install.

    Better Support for Apple Silicon, Xcode 13, and iOS

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search