"Response with status: 0 for URL: null" on actual android device


#1

Hi everyone,
My application can send http calls to and get data from my backend server just fine when tested with ionic serve. But when I build and run it on an android device it instead gives the error

EXCEPTION: Response with status: 0 for URL: null
GET net::ERR_TIMED_OUT

I don’t think this is a CORS error, as my backend is set up to allow for that, and because other posts seem to imply CORS issues are not supposed to happen on device, only in serve. Any idea why this might be happening just on device and not in serve, and how i might fix it?


#2

I’m not sure about your particular situation, but CORS problems do indeed occur on devices. I never use emulators, and have run into problems when API endpoints were not properly whitelisted.


#3

Turns I had a firewall up stopping incoming traffic to my server from other devices.

Followed this to allow my server to actually be reachable.