skip to Main Content

I am using android emulator and when i send request to localhost it gives me error. I have tried the forwarding the port also ngrok but none of them worked for me. It always gives me error.
[Error:Network Error].

2

Answers


  1. IN Emulator go to setting->click on Network and Internet ->then select Internet->select available network and then re-run your project and check it will work

    Login or Signup to reply.
  2. Please try http://10.0.2.2:8080 instead of localhost:8080.

    If you are referring your localhost on your system from the Android emulator then you have to use http://10.0.2.2:8080/ Because Android emulator runs in a Virtual Machine therefore here 127.0.0.1 or localhost will be emulator’s own loopback address.

    Original Answer Source

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search