'Configure the ANDROID_SDK_ROOT environment variable
Going through process of setting up Android emulator for React Native Following React documentation on website.
Instructions are as such:
Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc) config file:
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk export
PATH=$PATH:$ANDROID_SDK_ROOT/emulator export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
My device: 2019 Intel MacBook Pro with macOS Monterey 12.3
I tried vim.zprofile to no avail. Honestly not sure how to proceed.
when i run react-native run-android the build always fails
Solution 1:[1]
First Open the respective file from terminal using
open -a TextEdit /Users/<myname>/.bash_profile
*use .bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc)
then when the text file opens add the respective lines to this text file.
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
hit save
CHECK IF THIS IS DONE CORRECTLY
Type source
$HOME/.bash_profilefor bash orsource $HOME/.zprofileto load the config into your current shell.Verify that ANDROID_SDK_ROOT has been set by running
echo $ANDROID_SDK_ROOTand the appropriate directories have been added to your path by running ``echo $PATH```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pulkit Asri |
