macos - 如何使用 Rosetta 在 Mac 上解决 'react-native' 和 cocopods 的错误

标签 macos react-native cocoapods rosetta

我正在尝试在带有应用程序芯片的新 Mac 计算机上执行 native 项目。
按照某些论坛的建议将终端更改为使用 Rosetta 打开
安装了 cocoa pod 1.10.1 版本
使用 NPM 14.16.0 和 React 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>'
感谢任何帮助。

最佳答案

react_native_post_install"react-native": "0.64.0", .
我经历了这将我的博览会创建的项目转移到原始 react-native 的过程。
对我来说,我使用的是 "react-native": "~0.63.4",但是从 0.64 新版本中复制 Podfile reactive-native init .

关于macos - 如何使用 Rosetta 在 Mac 上解决 'react-native' 和 cocopods 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66833868/

相关文章:

ios - SceneKit 使用两个向量设置旋转

ios - react-native-maps:必须将 AirGoogleMaps 目录添加到您的 xCode 项目以支持 iOS 上的 GoogleMaps

module - 有人开始创建 React Native API/插件/模块了吗?

ios - 如何从我的 podfile 中找到 GitHub 项目?

xcode - Developer pod 单元测试的代码覆盖率

linux - 在 OSX 10.9 上 Pstack 进程

objective-c - 帮助进行简单的 5 星级评级控制

macos - 从 Interface Builder 中的表头中删除排序顺序?

javascript - 如何在React Native中以两列显示卡片?

ios - 在不包含源代码的情况下创建 CocoaPod 库