Could not connect to development server - React Native

Viewed 172

I am creating an app using react native. I tried to change a file path to an image within my code and when I ran my app on the iOS emulator the following message was displayed.

error

I have tried a number of different methods such as closing the terminal and running the app again.

I also tried running localhost:8081 in my browser and was given the following message

erorro2

I have also tried deleting my node_modules folder and running yarn but this still hasn't fixed the problem.

Any ideas as to how I would fix this?

3 Answers

You can try to clean xcode, remove app in the simulator

cd ios
xcodebuild clean

run bundler

react-native start --reset-cache

Replace the actual IP Address with the "localhost" in the Url and that should fix the issue if the url is proper.

Fully delete the app on the iOS Simulator, then rebuild the app from xcode.

Related