Cleartext http traffic not permitted
To do this in Android 9 Pie you will have to set a networkSecurityConfig in your Manifest application tag like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application android:networkSecurityConfig="@xml/network_security_config">
</application>
</manifest>
Then create a xml file named network_security_config just like the way you have named it in the Manifest and the content of your file should be like thisðto enable all requests without encryptions:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
If this is not working, please make your request from a secure domain(HTTPS).
I also faced the same issue recently with android 9 pie.
I added in my Manifest
android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute"
second line is mentioned is to ignore the warning for SDK less than 23.
Add this into your Manifest
android:usesCleartextTraffic="true"
like this..
<application
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:label="@string/app_name"
android:theme="@style/AppTheme">
...
</application>