Reputation: 1765
On an M1 Mac, with npm 8.3.1
& node 17.4
, when I run npx react-native run-ios
I receive 2 errors:
The following build commands failed:
CompileC /Users/Steven/Library/Developer/Xcode/DerivedData/HelloSteve-hghgfcwemhoaiacfwlophutqqzbh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/SysUio.o /Users/Steven/Documents/Projects/React\ Native/HelloSteve/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
CompileC /Users/Steven/Library/Developer/Xcode/DerivedData/HelloSteve-hghgfcwemhoaiacfwlophutqqzbh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/NetOps.o /Users/Steven/Documents/Projects/React\ Native/HelloSteve/ios/Pods/RCT-Folly/folly/net/NetOps.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
(2 failures)
From this answer, the line flipper_post_install(installer)
didn't exist in the Podfile.
From this answer, I commented out # use_flipper!()
in the Podfile, ran pod install
then npx react-native run-ios
and received a similar error:
The following build commands failed:
CompileC /Users/Steven/Library/Developer/Xcode/DerivedData/HelloSteve-hghgfcwemhoaiacfwlophutqqzbh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/SysUio.o /Users/Steven/Documents/Projects/React\ Native/HelloSteve/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
(1 failure)
I tried the solution here, (commenting out the line typedef uint8_t clockid_t;
in Time.h) but that didn't work either.
Help appreciated.
Upvotes: 10
Views: 28957
Reputation: 69
1.Open your Xcode project.
2.Navigate to your project's target (usually named after your app) in the Project Navigator on the left.
3.Go to the "Build Settings" tab.
4.Search for the "Excluded Architectures" setting.
5.Add the arm64 architecture to the list of excluded architectures.
6.Save your project settings.
After making this change, you can run pod install to ensure that the pods are only installed with the x86_64 architecture.
Upvotes: 0
Reputation: 51
I also faced this issue but not on M1 Mac
I found that if I create a project in a folder that contain a white space Learning RN/NewProject, there're an error when we run pod install
I tried to remove the whitespace in folder name LearningRN/NewProject and it worked well.
Upvotes: 5
Reputation: 356
I ran into a similar issue when updating the project target OS version.
Actually Xcode will ask you to change the target OS version for the different packages, which then lead to not finding the RCT package anymore for me.
So when xcode tells you there is a good option to change the target settings for different pods, be very careful with that. Either do it step by step and try out or leave it as is, as long as it is building and running.
npm install
then pod install
respectively arch -x86_64 pod install
since I am also running on M1.
Since it might have to do something with that as well I would also disable arm64 in xcode your projects target build phases under build settings "excluded architectures" and only install pods with arch -x86_64 pod install
.
Upvotes: 2