Repository navigation
Description
Description
Bootstrapped a new react-native project and got the following warning on pod install:
[!] Do not use "pod install" from inside Rosetta2 (x86_64 emulation on arm64).
[!] - Emulated x86_64 is slower than native arm64
[!] - May result in mixed architectures in rubygems (eg: ffi_c.bundle files may be x86_64 with an arm64 interpreter)
[!] Run "env /usr/bin/arch -arm64 /bin/bash --login" then try again.I'm running on zsh (M1 macOS 12.1), so I ran the following but the warning remained:
env /usr/bin/arch -arm64 /bin/zsh --login
cd ios
pod installPreviously (on RN 0.66) I had run the following commands to install x86_64 ffi, which allowed me to successfully run pod install on M1. Other than that, I'm working on a fresh workstation.
arch -x86_64 gem install --user-install ffi -- --enable-libffi-alloc Version
0.67.1
Output of npx react-native info
System:
OS: macOS 12.1
CPU: (10) arm64 Apple M1 Pro
Memory: 103.91 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.2/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Watchman: 2022.01.17.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.1 => 0.67.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
npx react-native init foo --template react-native-template-typescript
cd foo/ios
pod installSnack, code example, screenshot, or link to a repository
No response
Activity
snips11 commentedon Feb 1, 2022
I am having a similar problem, have there been any fixes yet?
dhairyasenjaliya commentedon Feb 2, 2022
did you try to disable hermes_enabled in pod ?
snips11 commentedon Feb 2, 2022
adil2166 commentedon Feb 2, 2022
same here I am using react-native 0.67.2 on mac m1 with xcode13.2.1.
react-native 0.66 is working fine but facing this issue in react native 0.67
mohamedalkhawam commentedon Feb 3, 2022
I'm having the same problem here with 0.67.2 of react-native.
I couldn't be able to fix it yet
richardgirges commentedon Feb 4, 2022
hermes is already disabled by default
vinodsantharam commentedon Feb 6, 2022
I started my project with a MBP early 2015. Then I changed my laptop to MB Air M1 last summer. A lot of struggling but I figured out to rebuild everything with Android & iOS.
I have updated mac OS to Monterey. I feel like 7 months ago. I had to reinstall node, npm, react-native. I have the same message with the pod install. I don't know what happened when upgrading the os but it seems that I lost a couple of stuff.
I ran the command mention by @richardgirges:
arch -x86_64 gem install --user-install ffi -- --enable-libffi-allocStill not working.
Then I ran this command (which I did when I moved to my MB Air M1):
ios/arch -x86_64 pod installThe pods are installed and I can launch my project.
Not sure that's the best steps to do but I can work for now.
Hope it would help you guys.
kavitha-viamagus commentedon Feb 7, 2022
same issue here also, can anyone help to fix that warning?
Linuhusainnk commentedon Feb 9, 2022
same issue any solution
rcerrejon commentedon Feb 9, 2022
+1
Ekaanth commentedon Feb 10, 2022
+1
mmeksasi commentedon Feb 13, 2022
+1
rkyli commentedon Feb 14, 2022
+1 need help on that , thanks... for urgent project~
DavidAPears commentedon Feb 14, 2022
Same, M1 seems to be the issue.
brascene commentedon Feb 14, 2022
Same here, RN 0.67.1 on M1 Mac with Xcode 13.2.1.
ridafkih commentedon Feb 18, 2022
What worked for me was installing cocoapods through brew, rather than gem.
After that, you can navigate over to the
ios/directory in your project, and install away.That should get you up and running on your M1 device of choice! Enjoy!
DavidAPears commentedon Feb 18, 2022
This cleared these error messages - thanks @ridafkih - top tip.
brownieboy commentedon Feb 19, 2022
I got a "pod command not found" error after installing cocoapods via brew.
I ran
brew link --overwrite cocoapodsto fix that. (The brew install process does actually tell you to do that, but I missed it!)Update RNTester documentation for Mac M1
JuliyaShirokova commentedon Mar 9, 2022
Same issue.
Apple M1
react-native 67.3
XCode -12.5
qasimgit commentedon Mar 26, 2022
This worked for me! Thanks Buddy! ✌️
riconroy commentedon Apr 20, 2022
I would also suggest removing all the cocoapod components. You can get that list with:
gem list --local | grep cocoapodsbillnbell commentedon May 18, 2022
I did not have to do 99% of this.
adiffmike commentedon Jun 28, 2022
So I recently solved this. Ended up brew was running under Rosetta from an old installation causing a bunch of packages to also run under Rosetta it seems.
Anyway I ran
brew configand there's a lineRosetta 2: trueusually your brew prefix will be/usr/localinstead of/opt/homebrewwhich is the new brew prefix for using arm64.I blew away the old brew (had to download the uninstall.sh package to run it with a path flag to point to the old brew install), reinstalled my packages, including nvm, chruby, pyenv etc. ( I wish I had saved a list of my current brew packages on the old install before I did this) and then installed cocoapods with brew. Now the error is gone.
This may have been my issue but if
brew install cocoapodsis not your fix it could be because your brew version is still running under Rosetta.tcco commentedon Jan 7, 2023
For iterm2 users, ensure your arch is
arm64as mine was coming up asi386. I launched terminal with rosetta and was able to install brew properly to/opt/homebrewwhere iterm2 was pushing to intel prefixing.refer to https://vineethbharadwaj.medium.com/m1-mac-switching-terminal-between-x86-64-and-arm64-e45f324184d9
github-actions commentedon Mar 29, 2024
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.