Skip to content Skip to sidebar Skip to footer

Dependency Org.apache.httpcomponents:httpclient:4.5 Is Ignored For Debug As It May Be Conflicting With The Internal Version Provid

I was trying to upload a image to server. As im new for the android i was trying with the others code. This is my error:Error file This is my activity file:- import android.app.Act

Solution 1:

If you are using target sdk as 23

then inside the build.gradle add:

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

as Apache Http is deprecated with the arrival of Marshmallow.

And according to this question, do not use any of these gradle files as it seems broken,

compile'org.apache.httpcomponents:httpcore:4.4.1'compile'org.apache.httpcomponents:httpclient:4.5'compile'org.apache.httpcomponents:httpclient-android:4.3.5.1'

Hope it helps!

Solution 2:

Way 1:

You need to use in build.gradle

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

If you use latest version of android SDK.

Way 2:

Use HttpURLConnection class instead of HTTPClient. HttpURLConnection is more efficient than HTTPClient.

Post a Comment for "Dependency Org.apache.httpcomponents:httpclient:4.5 Is Ignored For Debug As It May Be Conflicting With The Internal Version Provid"