2

I'm using org.apache.http.client in the app I recently moved from Eclipse to Android Studio and I meet a new problem. Despite the fact that I have added a dependency to org.apache.httpComponents.httpCore_4.4.4.jar, which caused errors in the editor to disappear, when building the project, I get the following error message : "error : package org.apache.http.client does not exist".

Where am I wrong and what should I do to correct the problem?

Zelig63
  • 1,592
  • 1
  • 23
  • 40

1 Answers1

0

Android 6.0 release removes support for the Apache HTTP client you can use HttpURLConnection instead

or you can add

useLibrary  'org.apache.http.legacy' 

in your build.gradle for target sdk 23

android{
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    useLibrary  'org.apache.http.legacy'
}

see this link

KDeogharkar
  • 10,939
  • 7
  • 51
  • 95