React Native – 在初始化项目后,运行 “yarn ios” 不起作用

huangapple go评论74阅读模式
英文:

React Native - yarn ios doesn't work after initializing the project

问题

我是Mac OS和其系统以及M1的新用户。
安装了我的项目的依赖项并尝试运行yarn iOS后出现了以下错误:

* 构建失败 **

以下构建命令失败:
        CompileC /Users/Library/Developer/Xcode/DerivedData/cemfgnbnzwyxlydpmalbfirprbcu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/arm64/RNSScreenViewEvent.o /Users/Trampo/node_modules/react-native-screens/ios/RNSScreenViewEvent.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (在目标 'RNScreens' 中来自项目 'Pods')
(1 失败)
英文:

I'm a new user to Mac OS and its system and M1.
After install dependencies of my project and trying yarn iOS

* BUILD FAILED **


The following build commands failed:
        CompileC /Users/Library/Developer/Xcode/DerivedData/cemfgnbnzwyxlydpmalbfirprbcu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/arm64/RNSScreenViewEvent.o /Users/Trampo/node_modules/react-native-screens/ios/RNSScreenViewEvent.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNScreens' from project 'Pods')
(1 failure)

答案1

得分: 0

维护 React Native 时,您还需要管理 iOS 的 Pod 文件。因此,请转到您的 iOS 文件夹并更新您的 Pods。

终端命令:

cd ios/ && pod install --repo-update
英文:

For React Native you also have to maintain the ios pod files. So, go to your ios folder and update your pods.

Terminal command:

cd ios/ && pod install --repo-update

答案2

得分: 0

I change React Native version to 0.64.4,
run yarn,
cd iOS
pod install
pod update,
Xcode and terminal (iterm2) to running with rosetta.

Works, thanks.

英文:

I change React Native version to 0.64.4,
run yarn,
cd iOS
pod install
pod update,
Xcode and terminal (iterm2) to running with rosetta.

Works, thanks.

huangapple
  • 本文由 发表于 2023年2月10日 03:56:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75403790.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定