Top Menu

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday 26 November 2015

Cannot resolve symbol HttpGet,HttpClient,HttpResponce in Android Studio

Today I was facing this issue "Cannot resolve symbol DefaultHttpClient" while parsing JSON in my application.

So Friends!! if you are also facing or will face the same issue then I'm giving you the solution for it. HttpClient was deprecated in API Level 22 and removed in API Level 23, You have to use URL Conntection. If you need SDK 23, add this to your gradle:

android {
    useLibrary 'org.apache.http.legacy'
}

Please remove all jar files of Http from libs folder and add below dependencies in gradle file:

compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'org.apache.httpcomponents:httpcore:4.4.3'


Read more...