Search code examples
xcodereact-nativecocoapods

undefined method `__apply_Xcode_12_5_M1_post_install_workaround'


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>'


Solution

  • 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