can't run react native project in simulator from command

329 views Asked by At

I am new in RN, and frankly in any modern front-end tools. So, I am working on an existing project, where I just run

npx react-native start

to run the project from the terminal, when the packager has started, I run

npx react-native run-ios

on another terminal window, which pretty reluctantly starts the ios simulator and opens the app as well. but the problem occurs when I run

npx react-native run-android

on the same windows, it gives throws an error as given in the screenshot: enter image description here

To solve the problem, I always open my Android Studio, and build and run the app, which runs the app in the android simulator. But I would really appreciate if there are some JavaScript or RN geeks who can help me run the app in android by the command

npx react-native run-android

I run a mac, use VS Code, I have yarn, npm installed.

1

There are 1 answers

1
nazmul On

Just try to remove the virtual device from avd manager in android studio and recreate it again. I also faced this issue recently and this is how i solved it. Also, check for any available update in android studio build tools.