Network Error (cordova)

After I build my application I get:Network error for any remote request.
I add whitelist-plugin and my I add these lines to my config.xml
<plugin name=“cordova-plugin-whitelist” spec="~1.3.3" />
<allow-navigation href="" />
<allow-intent href="
" />
<access origin="*" />
<access origin=“https://srssms.ir” />
<access origin=“http://srssms.ir” />

And also in my head:
<meta http-equiv=“Content-Security-Policy” content=“default-src ‘self’ ‘unsafe-eval’ data: blob: filesystem: ws: gap://ready file: cdvfile: https://ssl.gstatic.com ; style-src ‘unsafe-inline’; script-src ‘unsafe-inline’ ‘unsafe-eval’; img-src data: ‘unsafe-inline’; connect-src ‘unsafe-inline’; frame-src ; worker-src ; child-src ;”>

but it doesn’t work.

@nolimits4web May I request help?

whitelist has to do with navigation inside your webview. for api calls, it looks like your CSP is blocking.

Connect your phone to computer, launch app, and open inspector in Chrome and see what is the issues exactly

1 Like

When I use [email protected], It work well but [email protected] has problem.

@nolimits4web how can I disable CSP in chrome?

It is in your index.html file

I found a solution for my problem. It looks like Android is not allowing requests to by default, as stated in this thread: 192.168.l.254 Internet … I use [email protected] with [email protected] but allways I get network error on mobile device and emulator. quick solution is that checking url and request headers and comparing with other ways when you can get the right response.