Android studio: cannot resolve HttpClientBuilder

I ran into a weird problem on android studio. I am using apache libraries to create some http request and I need to change

org.apache.http.impl.client.DefaultHttpClient; 

which is deprecated with

 org.apache.http.impl.client.HttpClientBuilder; 

but Android studio does not find this package. How can i do this?

+6
source share
2 answers

Add to build.gradle and sync

 compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5' 
+10
source
 compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1' 

4.3.5.1 is the latest version :)

+2
source

Source: https://habr.com/ru/post/985795/


All Articles