5

我正在尝试在带有应用芯片的新 Mac 计算机上执行一个反应原生项目。按照某些论坛的建议,将终端更改为使用 Rosetta 打开

使用 NPM 14.16.0 安装了 cocoa pods 1.10.1 版本并响应 Native 版本 0.63.4 和 Xcode 版本 12.4 并尝试在 iOS 文件夹中运行 pod install 命令。我收到以下错误。

错误

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

undefined method `react_native_post_install' for #<Pod::Podfile:0x00000001572d90f8>

/Users/vvvvv/WebstormProjects/Reer/ios/Podfile:27:in `block (3 levels) in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:897:in `run_podfile_post_install_hook'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

感谢任何帮助。

4

1 回答 1

8

tldr:更新您的版本react-native以匹配您的 Podfile。

是在react_native_post_install中引入的"react-native": "0.64.0"

对我来说,我已经"react-native": "~0.63.4"安装了,但使用的是 0.64 fresh 的 Podfile(复制/粘贴)reactive-native init

我经历了将我在世博会创建的项目转移到原始反应原生的过程。

于 2021-04-17T09:23:56.590 回答