I use visual studio code for all of my programming. I use virtual android devices from android studio to be my emulators for developing mobile apps. I currently run on arch linux, garuda distro. I use npx create-react-native-project within the given directory. When I run npm start it gives this https://imgur.com/syyRqbh in the terminal. When I select option A to run on android, I get this error message as shown in the image. I'm also trying to figure out a way that I can get an iphone emulator as well so that I can develop for both at the same time as the expo create command builds files for both ends, but I do not own a mac device of any sort. Thanks in advance
#[solved] I honestly don't know how to label this so please read
1 messages · Page 1 of 1 (latest)
Does the folder ~/Android/Sdk exist?
if you would not mind to walk to me through finding that so I can make sure I am correct, then I will more than happily tell you yes or no. I am still new to this OS.
The only things I can do is use pacman and the applications I can install
ls ~/Android
╭─mek@FireDragon in ~ took 9ms
╰─λ ls ~/Android
drwxr-xr-x - mek 10 May 11:21 Sdk
╭─mek@FireDragon in ~ took 4ms
╰─λ
okay
in the command line, type export ANDROID_HOME=/home/mek/Android/Sdk
then run the npm start thing again
or maybe it needs to be export ANDROID_HOME=/home/mek/Android
not sure
I created a test folder, and am trying this first. bare with me
where did you do the export command
oh my fault. I'm waiting. going to delete the test folder and try again
wait
I'm sorry
ok so first I did my keyboard short cut for terminal
then in that terminal I typed
you have to do the export command and the npm start command in the same terminal window
inside vscode's terminal
ok so then I can alter my package.json to do that for me. one moment while I give that a try
you only need to do the export once when you open the terminal
but doing it every time won't hurt anything
i'm not sure exactly how the package.json will propagate environment variables
if it runs the export in the package.json i'm not 100% sure that the environment will be passed on to the main process
it probably will though
ok so I'm starting over
I created a new test folder and have ONLY ran npx create-react-app ./
one moment while it builds the app please. I'm sorry
ok now copy/pasting your code into the terminal
ok I'm messing up somewhere so please let me tell you what I'm doing as I do it and then comment because I'm getting really confused. I'm sorry
first I'm making a test folder in my documents library then opening it in vscode and running npx create-react-native-app ./ and I'll message again when that's done
ok
now just
export ANDROID_HOME=/home/mek/Android/Sdk
then whatever command you need to do to start it
it says npm run android there
run those both at the same time?
export
then you can do whatever after
export sets the environment variable for everything you run in the terminal
omg you're a life saver. so now how can i do the same thing for iOS since it builds a folder for both OS
right
right
it resets when you open a new terminal
there are many ways to make it permanent though
ok so how can I dev for both android and iOS at the same time on 2 different virtual devices? I still do not have an iOS virtual device
it says there that you need to use a macOS machine
idk anything about this
ok. np. tyvm for yourt hrelp!
you're welcome 👍
This command can only be ran in a active ticket
just rename the thread to add a [SOLVED] at the beginning