Ionic 2 – error running on Android device: Net:: err_ CONNECTION_ TIMED_ OUT

Sorry, my English is not good

I have built an application using ionic 2 for Android. In this application, I need to get information from the API. When I run in the browser (ion server), it can work normally

The problem is that when I run on my device (Android 6.0.1), I encounter this problem:

Then I searched how to solve this problem, and I tried a lot of things

I have Cordova plugin whitelist, and my config.xml looks like:

<content src="index.html" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" subdomains="true" />

I put it in my index.html:

<Meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; frame-src *; media-src *;">

I've read a lot of documents on this issue, but I haven't found any really useful articles

Can anyone help me?

thank you

resolvent:

The obvious connection problem described in the error

Make sure that the resources you are trying to access through the application can be accessed directly in the mobile browser. If you ensure that they are accessible in the device browser, the application connection problem will be solved. Cheers

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>