создайте XML-файл res / xml / network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
и добавьте 2 тега тега в свой AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest......>
<application android:networkSecurityConfig="@xml/network_security_config">
<activity..../>
......
......
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>
</application>
Также добавьте useLibrary 'org.apache.http.legacy 'в вашем приложении сборки gradle
defaultConfig {
applicationId "com.ascorb.merazinn"
minSdkVersion 19
targetSdkVersion 28
versionCode 6
versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
}