Cordova Not able to connect Internet in the Latest Android Versions |
|
Hi,
Recently i have updated an Android App to the Latest version (Android API 19+ and Target SDK 28) and facing Internet Connectivity issues in the Latest Android Versions (for e.g. Android 9). Does any one come across this Problem and have Solution For this? I am using Cordova to build the Android APK.
Regards,
Rajkumar
|
RajKumar |
Answered# (13)
|
Reply For This Question
|
|
|
Answer(s) Posted
|
|
Cordova Not able to connect Internet in the Latest Android Versions
|
|
This issue has been resolved. Please find the below steps to enable Internet Connection on the Latest Android Version (9).
1. Create file under res/xml/network_security_config.xml
2. network_security_config.xml should contain the below information
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">www.mydomain.com</domain>
</domain-config>
</network-security-config>
3. Inside the AndroidManifest.xml, add android:networkSecurityConfig="@xml/network_security_config" in application node as an Attribute.
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:networkSecurityConfig="@xml/network_security_config"
...>
...
</application>
</manifest>
|
Raj Kumar
| Answered# (13)
|
|
|
Post Your Answer
|
Please login to post your answer.
|
|
|