简体   繁体   中英

network request failed when running expo app on android device

我的 expo xde 的屏幕截图,右边有错误日志。

I am using a localhost server for my app development on expo. I get this error on my android device. My server and api works fine as I have tested it on postman. It works well in the browser too. I am already using my ip address in the fetch function instead of localhost. The fetch also works fine on genymotion android emulator. The issue is only on my actual android device.

Thanks

Solved the issue finally. The issue was my firewall(ufw) which was not allowing access for public ports. sudo ufw allow from 192.xxx.x.xxx to any port 80 helped me as it allows acces to publicly open ports.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM