react-native: React Native fails to start on Apple Chip M2 with macOS Monterey 12.4
Description
Hi,
I currently need to build an app and I chose RN in order to work on cross platform (iOS and Android). I never had issues before working with RN before upgrading to the Apple M series chipset.
I followed some commands to install all the packages needed to start working on my app following this guide, but I am getting the following error after running npx react-native run-ios
.
Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeApp.xcodeproj.
I have tried multiple solutions from other “open issues”, but I couldn’t manage to resolve the issue and I would get even more issues by following some proposed solutions from other GitHub users.
Here are my versions:
- npm: 9.5.1
- node: v19.8.1
- pod: 1.12.0
- gem: 3.0.3.1
- react-native: 0.71.6
- npx: 9.5.1
- Brew: Homebrew 4.0.10-dirty
My computer specs:
- macOS Monterey: 12.4
- Chipset: Apple M2
I was wondering if anyone has any suggestions on how I can fix this error. Are there any issues with the versions of the packages?
React Native Version
0.71.6
Output of npx react-native info
System: OS: macOS 12.4 CPU: (8) arm64 Apple M2 Memory: 598.59 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.8.1 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.5.1 - /opt/homebrew/bin/npm Watchman: 2023.03.27.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.0 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8815526 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 19.0.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.6 => 0.71.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- sudo gem install -n /usr/local/bin ffi cocoapods
- npx react-native init MyProject
- cd MyProject
- npm start
(open another Terminal window in the MyProject directory)
- npm run ios
Snack, code example, screenshot, or link to a repository
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (3 by maintainers)
@georgeka98 Since you don’t have a Pods folder, I bet you haven’t installed dependencies of the iOS project. I suggest you Install cocoapods, and then cd to
ios
path then usepod install
to install dependencies for the iOS project. I assume this should work because the issue is just a lack of dependencies. 😂It looks like something funky is going in your
app/awesomeProject/ios/Pods
./Pods
directory,npm run ios