Android: Cleartext HTTP traffic not permitted Android 9

Leo N
Dec 23, 2018

Starting with Android 9.0 (API level 28), cleartext support is disabled by default.

Option 1 -

Create file res/xml/network_security_config.xml -

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">Your URL(ex: 127.0.0.1)</domain>
</domain-config>
</network-security-config>

--

--

Leo N

πŸŽ“ β€œA person who never made a mistake never tried anything new.” β€” Albert Einstein