#[solved] I honestly don't know how to label this so please read

1 messages · Page 1 of 1 (latest)

misty moth
#

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

untold furnace
#

Does the folder ~/Android/Sdk exist?

misty moth
#

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

untold furnace
#

ls ~/Android

misty moth
#
 ╭─mek@FireDragon in ~ took 9ms
 ╰─λ ls ~/Android
drwxr-xr-x - mek 10 May 11:21  Sdk

 ╭─mek@FireDragon in ~ took 4ms
 ╰─λ 
untold furnace
#

okay

misty moth
untold furnace
#

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

misty moth
untold furnace
#

where did you do the export command

misty moth
#

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

untold furnace
#

you have to do the export command and the npm start command in the same terminal window

misty moth
#

ok I'm a bit confused. do I do that in regular terminal or inside vscodes terminal?

untold furnace
#

inside vscode's terminal

misty moth
#

ok so then I can alter my package.json to do that for me. one moment while I give that a try

untold furnace
#

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

misty moth
#

ok so I'm starting over

#

I created a new test folder and have ONLY ran npx create-react-app ./

untold furnace
#

ok

#

export ANDROID_HOME=/home/mek/Android/Sdk

#

npm start

misty moth
#

one moment while it builds the app please. I'm sorry

#

ok now copy/pasting your code into the terminal

untold furnace
#

you can also just do ANDROID_HOME=/home/mek/Android/Sdk npm start

#

either works

misty moth
#

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

untold furnace
#

ok

misty moth
#

after doing that, it now looks like this

#

so now what

untold furnace
#

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

misty moth
#

run those both at the same time?

untold furnace
#

export

#

then you can do whatever after

#

export sets the environment variable for everything you run in the terminal

misty moth
#

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

untold furnace
#

there are many ways to make it permanent though

misty moth
#

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

untold furnace
#

idk anything about this

misty moth
#

ok. np. tyvm for yourt hrelp!

untold furnace
#

you're welcome 👍

jovial pendantBOT
#

This command can only be ran in a active ticket

untold furnace
#

just rename the thread to add a [SOLVED] at the beginning