Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Emulated x86_64" warning doesn't go away (M1 mac) #33017

Closed
richardgirges opened this issue Feb 1, 2022 · 25 comments
Closed

"Emulated x86_64" warning doesn't go away (M1 mac) #33017

richardgirges opened this issue Feb 1, 2022 · 25 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@richardgirges
Copy link

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 install

Previously (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 install

Snack, code example, screenshot, or link to a repository

No response

@snips11
Copy link

snips11 commented Feb 1, 2022

I am having a similar problem, have there been any fixes yet?

@dhairyasenjaliya
Copy link

did you try to disable hermes_enabled in pod ?

@snips11
Copy link

snips11 commented Feb 2, 2022 via email

@adil2166
Copy link

adil2166 commented 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
Copy link

I'm having the same problem here with 0.67.2 of react-native.
I couldn't be able to fix it yet

@richardgirges
Copy link
Author

did you try to disable hermes_enabled in pod ?

hermes is already disabled by default

@vinodsantharam
Copy link

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-alloc
Still not working.
Then I ran this command (which I did when I moved to my MB Air M1):
ios/arch -x86_64 pod install
The 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.

@kavitha57
Copy link

kavitha57 commented Feb 7, 2022

same issue here also, can anyone help to fix that warning?

@Linuhusainnk
Copy link

same issue any solution

@rcerrejon
Copy link

+1

2 similar comments
@Ekaanth
Copy link

Ekaanth commented Feb 10, 2022

+1

@mmeksasi
Copy link

+1

@rkyli
Copy link

rkyli commented Feb 14, 2022

+1 need help on that , thanks... for urgent project~

@DavidAPears
Copy link

DavidAPears commented Feb 14, 2022

Same, M1 seems to be the issue.

react-native: 0.67.2
M1 Mac
XCode: 13.2.1

@brascene
Copy link

Same here, RN 0.67.1 on M1 Mac with Xcode 13.2.1.

@ridafkih
Copy link

ridafkih commented Feb 18, 2022

What worked for me was installing cocoapods through brew, rather than gem.

sudo gem uninstall cocoapods
arch -arm64 brew install cocoapods

After that, you can navigate over to the ios/ directory in your project, and install away.

pod install

That should get you up and running on your M1 device of choice! Enjoy!

@DavidAPears
Copy link

This cleared these error messages - thanks @ridafkih - top tip.

@brownieboy
Copy link

brownieboy commented Feb 19, 2022

What worked for me was installing cocoapods through brew, rather than gem.

sudo gem uninstall cocoapods
arch -arm64 brew install cocoapods

I got a "pod command not found" error after installing cocoapods via brew.

I ran brew link --overwrite cocoapods to fix that. (The brew install process does actually tell you to do that, but I missed it!)

cipolleschi referenced this issue Mar 4, 2022
Summary:
This Diff updates the RNTester README to support Mac M1 laptops.

## Changelog
[General][Changed] - Updated `rn-tester/README.md` to include instructions for Mac M1 users

Reviewed By: cortinico

Differential Revision: D34376951

fbshipit-source-id: 7195bddefb6e202261fef9b5f5225484c506fd9b
@JuliyaShirokova
Copy link

Same issue.
Apple M1
react-native 67.3
XCode -12.5

@qasimgit
Copy link

This worked for me! Thanks Buddy! ✌️

@riconroy
Copy link

What worked for me was installing cocoapods through brew, rather than gem.

sudo gem uninstall cocoapods
arch -arm64 brew install cocoapods

I would also suggest removing all the cocoapod components. You can get that list with:
gem list --local | grep cocoapods

@billnbell
Copy link
Contributor

billnbell commented May 18, 2022

I did not have to do 99% of this.

1. rm -rf ~/Library/Developer/Xcode/DerivedData/
2. softwareupdate --install-rosetta
3. sudo arch -x86_64 gem install ffi
4. brew install node
5. brew install watchman
6. -- close terminal and reopen a new one
7. rm -rf node_modules && yarn install
8. cd ios; pod deintegrate; pod install
9. cd ..; yarn ios

@adiffmike
Copy link

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 config and there's a line Rosetta 2: true usually your brew prefix will be /usr/local instead of /opt/homebrew which 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 cocoapods is not your fix it could be because your brew version is still running under Rosetta.

@tcco
Copy link

tcco commented Jan 7, 2023

For iterm2 users, ensure your arch is arm64 as mine was coming up as i386. I launched terminal with rosetta and was able to install brew properly to /opt/homebrew where iterm2 was pushing to intel prefixing.

refer to https://vineethbharadwaj.medium.com/m1-mac-switching-terminal-between-x86-64-and-arm64-e45f324184d9

Copy link

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.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests