我在 M1 Mac 上运行,按照此处的所有说明进行操作后,我无法运行任何形式的pod install. 当我这样做时,我收到以下错误......
[!] Invalid `Podfile` file: undefined local variable or method
`min_ios_version_supported' for #<Pod::Podfile:0x000000010ed18c60>.
Run Code Online (Sandbox Code Playgroud)
我尝试bundle install先运行bundle exec pod install,但随后遇到同样的错误。
我使用yarn而不是npm,我尝试删除并按照本网站上的其他答案node_modules运行,尽管我并没有真正期望它们能够工作。yarn cache clean
此外,我的Podfile确实在文件顶部包含所需的导入...
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
Run Code Online (Sandbox Code Playgroud)
我什至尝试手动输入min_ios_version_supportedat 12.4,因为这是我最近的项目正在处理的内容。这给了我一个不同的错误,我通过手动值输入再次修复了该错误,但这给了我一个不同的更复杂的错误,本质上告诉我最好实际解决问题而不是修补它。
最后,我尝试添加react-native.config.js文件。仍然收到相同的错误
我之前做过很多 React Native 项目,并注意到Podfile我的全新项目上的这个看起来与Podfile我过去使用的非常不同——我是否使用了尚未优化的新版本的 React?