1
votes

Running react native app in android emulator using port 8088 and I see this error.

I have tried running in default port 8081 and the basic app welcome page works ok but the changes are not reflected in the app. My work mcafee uses the same port so I have changed the port in Android emulator to '10.0.2.2:8088' and tried running react-native run-android --port 8088 and I see the error as shown here :

error

I have tried manually pasting index file to react-native/scripts folder, now I see this :

enter image description here

Thanks for your help.

3

3 Answers

0
votes

I fixed it using a post in https://github.com/facebook/react-native/issues/23908. Copied few files to older version and tried to restart the app in port 8088 - worked ok. Can see the changes reflected too :)

0
votes

I think you need to reverse your ports too.

enter this command on the project root

$ adb -s <device name> reverse tcp:8088 tcp:8088

also, check the link below for more info

https://facebook.github.io/react-native/docs/running-on-device

-1
votes

The solution is already given in the red screen above. They have suggested you to do the following.:

watchman watch-del-all
rm -rf node_modules && npm install
npm start --reset-cache
rm -rf /tmp/haste-map-react-native-packager-*

Try these commands while you're in root folder of App.js and running bash terminal. I had solved my problem just deleting node_modules folder and reinstalled node modules by npm install and then restart the app. Everything worked out fine!