0

I am just getting started in react native and followed all the steps given in https://reactnative.dev/docs/environment-setup for Windows -> Android .

And I have started the app using npm start after that I have tried to run the app in emulator with the command,

npm run android

and my package.json looks like,

 "scripts": {
 "android": "react-native run-android",
 "ios": "react-native run-ios",
 "start": "react-native start",
 "test": "jest",
 "lint": "eslint ."
 },

After entering the above command, I am getting the following error as connection refused,

enter image description here

Could you please kindly help how can I fix this issue and run the app successfully in the emulator?

asked Jan 13, 2023 at 2:48

1 Answer 1

2

1]set environment variable like this

enter image description here

if you don't know this see this video

2] cmd for run emulator in you project

emulator -avd avd <---avd is my emulator name 

3] run your project using this cmd for android

react-native run-android

hope this will help you!!

answered Jan 13, 2023 at 6:56
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.