1

I know this question is asket a lot of times. I'm using Api 28. I added this code in AndroidManifest.xml:

<application android:networkSecurityConfig="@xml/network_security_config"></application>

In xml/network_security_config.xml

<?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">mypage.com</domain> </domain-config> </network-security-config> 

Also tested on older API(Api 22) working, i get data from hosted Api(HTTP). Any other suggestions?

0

1 Answer 1

4

If you are using API 28+ please refer to this document.

You will see that since API 28 the value android:usesCleartextTraffic now defaults to false.

In your android manifest remove the xml you have previously written and simply use:

 <?xml version="1.0" encoding="utf-8"?> <manifest ...> <application android:usesCleartextTraffic="true" ...> ... </application> </manifest> ... 
Sign up to request clarification or add additional context in comments.

1 Comment

Added, same error again @JamesMallon

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.