I am receiving a Network Error when making https requests to my API that is only occurring while emulating with XCode. The problem does not occur when running locally www, or in a published website or on Android Studio emulators or published to android device.
Not sure if I am missing a permission or configuration, but I have tried adding “Local Network Usage”, “Location Always and When In Use” permissions to the Info.plist.
I do not believe its an issue with my server since it works on other platforms and I have already tried changing settings around such as allowing all origins through CORS and nothing has made a difference.
I am using Angular Capacitor v3 with axios. (I have also tried HttpClient with the same result)
The error occurs immediately and does not give specific information but here is the message:
[error] - %c2021-09-26T01:13:16.694Z ERROR color:red {“message”:“Network Error”,“name”:“Error”,“stack”:“capacitor://localhost/main.1.js:1:512713\ncapacitor://localhost/main.1.js:1:508465\nO@capacitor://localhost/polyfills.2.js:1:12849\nonInvokeTask@capacitor://localhost/main.1.js:1:142090\ncapacitor://localhost/polyfills.2.js:1:3118\ncapacitor://localhost/polyfills.2.js:1:9168\ng@capacitor://localhost/polyfills.2.js:1:21778\ny@capacitor://localhost/polyfills.2.js:1:22006”,
“config”:{“url”:“”,“method”:“post”,“data”:“{[data]}”,“headers”:{“Accept”:“text/plain”,“Content-Type”:“application/json”,“Access-Control-Allow-Origin”:“*”,“Authorization”:“Bearer [token]”},“transformRequest”:[null],“transformResponse”:[null],“timeout”:0,“withCredentials”:true,“xsrfCookieName”:“XSRF-TOKEN”,“xsrfHeaderName”:“X-XSRF-TOKEN”,“maxContentLength”:-1,“maxBodyLength”:-1,“transitional”:{“silentJSONParsing”:true,“forcedJSONParsing”:true,“clarifyTimeoutError”:false}}}