Cordova 5.0.0 Android Application Cannot Connect to the Internet Using Android 4.0.0

I am developing a cordova application using windows 7. The emulator can connect to the Internet with a browser, but the application failed with a network error

check the link [link here]

Using latest android 4.0.0 for devleopment

Cordoba 5.0.0 Cordoba Android 4.0.0

I have already added the whitelist as a new plugin to the cordova project. check link

in the androidmenifest.xml file, permission is also granted

<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
+7
android cordova
source share
3 answers

I'm so sorry, are you adding the Content-Security-Policy meta tag? If you set the wrong version of the content security policy, this may cause this problem.

+1
source share

The answer is:

Ajax requests end after upgrading to Cordoba 5.0 + cordova-android@4.0

You need a whitelist plugin .

 > cordova plugin add cordova-plugin-whitelist 

Then add the following to config.xml :

 <allow-navigation href="*" /> 
+45
source share

The CIF answer is correct, but in order for anyone else to view it, I decided that I would send the default allowed configuration, which is created using cordova create

 <plugin name="cordova-plugin-whitelist" version="1" /> <access origin="*" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> <allow-intent href="tel:*" /> <allow-intent href="sms:*" /> <allow-intent href="mailto:*" /> <allow-intent href="geo:*" /> <platform name="android"> <allow-intent href="market:*" /> </platform> <platform name="ios"> <allow-intent href="itms:*" /> <allow-intent href="itms-apps:*" /> </platform> 
+3
source share

All Articles