Skip to main content

Network Security Exception in Android Retrofit Cleartext HTTP traffic not permitted

Create One directory in res/xml

Create file in xml directory

Past give below code :

<network-security-config>
    <base-config cleartextTrafficPermitted="true"/>
    <domain-config>
        <domain includeSubdomains="true">www.xyz.com</domain>>
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </domain-config>

</network-security-config>


Add one Line into AndroidMenifest.xm File


in application tag :


android:networkSecurityConfig="@xml/yourfilename"
android:usesCleartextTraffic="true"

Comments

Popular posts from this blog

Create Shared Prefrence Via XML In Android

Download Source Code : Click Here Output:

Sandeep Maheshwari on zee news