Skip to content
Discussion options

You must be logged in to vote

127.0.0.1 is your computer, iOS simulator understand it because the simulator is running on your computer, but on Android, the emulator is a "virtual machine" with its own networking, so 127.0.0.1 for it its the own emulator, not your computer.

You can enable port forwarding to send the 4002 port traffic to the emulator, or you can use 10.0.2.2 IP as it automatically loops to 127.0.0.1

https://developer.android.com/studio/run/emulator-networking

Also, note that using 127.0.0.1 won't work on real devices because of the same reason, it's better if you use the local IP of the computer instead, something like 192.168.1.30

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@LechLee
Comment options

@pwespi
Comment options

@jcesarmobile
Comment options

@LechLee
Comment options

Answer selected by LechLee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants