To begin with, I was using org.apache.http functions for a while now and error came when I tried to launch my app on API 28. It's working on API 26 and API 23, but suddenly something is wrong with API 28. Did Google made some changes?
相关问题
- Angular RxJS mergeMap types
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
Step 1:
create an xml file in
res/xml/network_security_config.xml
and copy the below code in it,Step 2:
now in your
Manifest.xml
addandroid:networkSecurityConfig="@xml/network_security_config"
under the<application>
tag. Done!To run org.apache.http.legacy perfectely in Android 9.0 Pie create an xml file
res/xml/network_security_config.xml
And add 2 tags tag in your AndroidManifest.xml
Also add
useLibrary 'org.apache.http.legacy'
in your app build gradleI had the same problem. I resolved it by using HTTPS, instead of HTTP. Apparently, a secure connection is now required.
Apache HTTP client deprecation