Ionic 4 android 9 CLEARTEXT http not permitted error

ionic 4 app sends http request for android version 6,7 but gives an error saying CLEARTEXT http traffic (not permitted). I have trying to solve this by adding android:usesCleartextTraffic="true"
but ionic default is true for usesCleartextTraffic.

and also i tried to change url http to https. but nothing works for me.

so i solved this issue temporarily by adding

 <domain includeSubdomains="true">localhost</domain>
 <domain includeSubdomains="true">YOUR-IP_ADDRESS</domain>

to my network_security_config.xml .

localhost for android version 6,7
YOUR_IP_ADDRESS for version 8,9