1

I hope you can help me. I have a problem with request HTTP

I have tried using:

  • clear text traffic

    android:usesCleartextTraffic="true"

  • network security config

    android:networkSecurityConfig="@xml/network_security_config"

network_security_config.xml :

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
 <domain includeSubdomains="true"><my IP request></domain>
</domain-config>
</network-security-config>

the result remains the same, response : run in android 11

but, the code can run on android 9

can anyone help me to solve it, thank you

1 Answers1

0

Please try with editing AndroidManifest.xml and app level build.gradle file with below

  1. AndroidManifest.xml file put <uses-library android:name="org.apache.http.legacy" android:required="false" /> under <application> tag

  2. In build.gradle file put useLibrary 'org.apache.http.legacy' on below compileSdkVersion under android{}

Android
  • 82
  • 1
  • 8