How to solve Android P DownloadManager stopping with “Cleartext HTTP traffic to 127.0.0.1 not permitted”?

后端 未结 2 1585
情深已故
情深已故 2020-12-05 07:48

I have already defined a custom network security config and included it in my manifest as recommended here

res/xml/network_security_config.xml:

相关标签:
2条回答
  • 2020-12-05 08:11

    Create a XML res/xml/network_security_config.xml

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <base-config cleartextTrafficPermitted="true" />
    </network-security-config>
    

    Reference this file in your tag Application, inside AndroidManifest.xml. Like:

    android:networkSecurityConfig="@xml/network_security_config"
    
    0 讨论(0)
  • 2020-12-05 08:34

    Replace the BASE_URL protocol from http://... to https://

    0 讨论(0)
提交回复
热议问题