How I got my entire React Native Environment set up in less than an hour on the new Apple M1 laptop, including troubleshooting.
Xcode š„
I recommend downloading and installing Xcode at the start ā itāll take the longest. Once youāre done setting up, run the application once and download the required components. Also, for command line tools:
$ xcode-select --install
If you end up running the above command before Xcode installs you might have to run this command to switch to Xcodeās CLI:
I use MacApps.link (a flavor of Ninite ā a Windows package management software) which handles the downloading of all other apps required on my work laptop.
$ curl -s 'https://api.macapps.link/en/chrome-dropbox-alfred-github-sublime-iterm-unarchiver-cyberduck-spotify-vlc-slack-whatsapp-discord' | sh
Choose whichever apps work for you.
IntelliJ IDEA š§š½āš»
Iāve been sucked into the IntelliJ ecosystem, and doubt Iāll ever be break away. Itās definitely worth the yearly Start by downloading the Jetbrains Toolbox, and through that get access to the latest version of IntelliJ IDEA Ultimate for Apple Silicon. Itās optimized for ARM chips.
For React Native dev of course I need to set up both native mobile dev environments. iOS was (unsurprisingly) straight-forward, but Android posed some problems. While the Studio initially installed without problems, when installing emulators I hit the real issues: the emulators that come with Android Studio donāt run on ARM Macs at all.
There is a ray of hope with someĀ preview versions of Android emulator for Apple M1Ā coming from Google. But donāt get your hopes up too high as thereās already a list of known issues (no webviews and no sound being probably the biggest dealbreakers for me) and no activity in the repo in the past month and a half. I did manage to use it to run the app Iām currently working on, though.
Personally, Iām sticking with running my Android apps on a real device. Less hassle and faster, more reliable testing. Itās also been my workflow before switching to ARM, so thatās not much of a problem for me.
Homebrew, the essential package manager you need, finally officially supported Apple Silicon on the 5th of February, 2021. Preferably follow the instructions on their website, but for posterity, Iāve added the commands below.
By now, if youāve already installed a handful of apps, you might have already come across Rosetta. For now, youāll have to make do with this translation layer until everyone switches over.
I also recommend duplicating iTerm and appending with _rosetta and running that application with the option āOpen using Rosettaā
Mac AppStore š»
When you first open it, there are a bunch of agreements youāll have to accept. The only applications I care for are Helium, ColorSlurp, and Amphetamine.
If you recently got the computer and ended up inadvertently downloaded the software update for MacOS, I recommend restarting your computer at-least once. This solved some of the issues.
Inside BOTH Pods and your workspace, navigate to Build Settings -> Excluded Architectures -> Debug and add arm64. Remember to make this change in both places otherwise it wonāt take effect.
Setting up React Native on Apple M1
How I got my entire React Native Environment set up in less than an hour on the new Apple M1 laptop, including troubleshooting.
Xcode š„
I recommend downloading and installing Xcode at the start ā itāll take the longest. Once youāre done setting up, run the application once and download the required components. Also, for command line tools:
If you end up running the above command before Xcode installs you might have to run this command to switch to Xcodeās CLI:
Other Applications š²
I use MacApps.link (a flavor of Ninite ā a Windows package management software) which handles the downloading of all other apps required on my work laptop.
Choose whichever apps work for you.
IntelliJ IDEA š§š½āš»
Iāve been sucked into the IntelliJ ecosystem, and doubt Iāll ever be break away. Itās definitely worth the yearly Start by downloading the Jetbrains Toolbox, and through that get access to the latest version of IntelliJ IDEA Ultimate for Apple Silicon. Itās optimized for ARM chips.
For React Native dev of course I need to set up both native mobile dev environments. iOS was (unsurprisingly) straight-forward, but Android posed some problems. While the Studio initially installed without problems, when installing emulators I hit the real issues: the emulators that come with Android Studio donāt run on ARM Macs at all.
There is a ray of hope with someĀ preview versions of Android emulator for Apple M1Ā coming from Google. But donāt get your hopes up too high as thereās already a list of known issues (no webviews and no sound being probably the biggest dealbreakers for me) and no activity in the repo in the past month and a half. I did manage to use it to run the app Iām currently working on, though.
Personally, Iām sticking with running my Android apps on a real device. Less hassle and faster, more reliable testing. Itās also been my workflow before switching to ARM, so thatās not much of a problem for me.
Chrome Extensions š§
Ghostery | Google Analytics Opt-out Add-on | uBlock Origin | React Developer Tools
Brew āļø
Homebrew, the essential package manager you need, finally officially supported Apple Silicon on the 5th of February, 2021. Preferably follow the instructions on their website, but for posterity, Iāve added the commands below.
Rosetta š¹
By now, if youāve already installed a handful of apps, you might have already come across Rosetta. For now, youāll have to make do with this translation layer until everyone switches over.
cd into your ios/ folder and run these commands
I also recommend duplicating iTerm and appending with _rosetta and running that application with the option āOpen using Rosettaā
Mac AppStore š»
When you first open it, there are a bunch of agreements youāll have to accept. The only applications I care for are Helium, ColorSlurp, and Amphetamine.
I also downloaded
Linear ā issue tracking tool,
Figma ā collaborative UI design tool, and
VEEER ā window manager for MacOS
from their respective websites.
Troubleshooting ā ļø
If you recently got the computer and ended up inadvertently downloaded the software update for MacOS, I recommend restarting your computer at-least once. This solved some of the issues.
CocoaPods LoadError:
Or
Missing architecture:
Inside BOTH Pods and your workspace, navigate to Build Settings -> Excluded Architectures -> Debug and add
arm64. Remember to make this change in both places otherwise it wonāt take effect.Another reference from StackOverflow.
Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1eb0e27a0) and ?? (0x1296d02b8). One of the two will be used. Which one is undefined.
Still figuring this one out. Fortunately it doesnāt affect development. Hereās another reference.
CompileC Error in ios/Pods/Flipper/xplat/Flipper.
In Podfile, update this line
With this:
Make sure to remove Podfile.lock and then run pod install after making this change.
Miscellaneous ā
Switching off last login time in terminals
Generating SSH keys for signing commits/ pulling repositories
Cleanse š
Clean your build in Xcode.
ā + Shift + KPurging the system might help.
Restart terminal after checking the option āOpen Using Rosettaā
Then try
Whenever I run into an issue, I
If nothing works, purge the entire repository and start over.
More troubleshooting hotfixes ā CompileC AppDelegate.m Error.