How to fix 'Cleartext HTTP traffic to x not permitted'
问题 I'm trying to make a post request to an http server, but when I try to get an input stream I get the error java.io.IOException: Cleartext HTTP traffic to x not permitted I've already tried putting android:usesCleartextTraffic="true" in my manifest, as well as making a network security config and setting the android:targetSandboxVersion to 1 app/src/main/res/xml/network_security_config.xml <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted