react-native: 0.73.1 iOS build failed on Apple Silicon Mac(M1 Pro), but I can do build on 0.72.8 version of React Native
@iron-leo I think that's a totally separate issue. Did you run `react-native start` before trying to build? metro no longer gets started automatically and IIRC that's the (not super helpful) error message it gives.
Take a look on issue, I tried many times with 0.73.1 but without luck:
_Originally posted by @evelant in https://github.com/facebook/react-native/issues/41938#issuecomment-1856530643_
React Native info
❯ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 14.2.1
CPU: (10) arm64 Apple M1 Pro
Memory: 163.91 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.18.2
path: ~/.nvm/versions/node/v18.18.2/bin/node
Yarn:
version: 1.22.21
path: ~/.nvm/versions/node/v18.18.2/bin/yarn
npm:
version: 9.8.1
path: ~/.nvm/versions/node/v18.18.2/bin/npm
Watchman:
version: 2023.12.04.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/lev.pasichnyi/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- watchOS 10.2
Android SDK:
API Levels:
- "31"
- "33"
- "34"
Build Tools:
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
System Images:
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.11005911
Xcode:
version: 15.1/15C65
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 3.1.4
path: /Users/lev.pasichnyi/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.1
wanted: 0.73.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
React Native doctor
❯ npx react-native doctor
Common
✓ Node.js - Required to execute JavaScript code
✓ npm - Required to install NPM dependencies
✓ Watchman - Used for watching changes in the filesystem when in development mode
✓ Metro - Required for bundling the JavaScript code
Android
✓ Adb - Required to verify if the android device is attached correctly
✓ JDK - Required to compile Java code
✓ Android Studio - Required for building and installing your app on Android
✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
✓ Gradlew - Build tool required for Android builds
✓ Android SDK - Required for building and installing your app on Android
iOS
✓ Xcode - Required for building and installing your app on iOS
✓ Ruby - Required for installing iOS dependencies
✓ CocoaPods - Required for installing iOS dependencies
✓ ios-deploy - Required for installing your app on a physical device with the CLI
✓ .xcode.env - File to customize Xcode environment
Errors: 0
Warnings: 0
About this issue
- Original URL
- State: open
- Created 6 months ago
- Comments: 16 (3 by maintainers)
Fix this issue by disabling hermes-engine in your podfile. Steps:
Delete pods and cache
arch -x86_64 pod deintegrate && arch -x86_64 pod cache clean --all
Add to podfile this line:
:hermes_enabled => false,
Here:
arch -x86_64 pod install
Try deleting the .xcode.env.local file. I have the wrong path to NODE_BINARY generated in it
Hi @jleem99 : Thanks for pointing the root cause for
cp -X
failing on MacOS. In our project we use anix
shell to build the iOS app and we do havecoreutils
present, so thats why we also faced this issue.Hello, we patched out the -X from the react-native script
ref -> https://github.com/status-im/status-mobile/pull/18563/files#diff-b3d31b1df4cceb663a7dba96bcc3ea45686afe2208d7945b6e7e269067d753fbR92-R96
@siddarthkay Yep, I had the similar issue and was able to resolve it by patching out the cp -X option.
But then I noticed that I had
coreutils
installed on my machine, which meant the GNU variant of cp was used during the build. And it was the root cause of the issue.https://ss64.com/mac/cp.html
@NedStar72 Still not able to run using command
I have the same error on a new RN project.
npx react-native info