Issue
In one of my old project, I am getting this error/suggestion in my app level build.gradle file:
httpclient defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar.
Check the screenshot below:
It seems the error is because of the dependency org.apache.httpcomponents:httpmime:4.5.12
I tried to find the solution over the internet. Tried 1 , 2 , 3 but nothing helped.
Any help would be appreciated.
Solution
I solved it by adding implementation "org.apache.httpcomponents:httpcore:4.4.13"
and excluding group: 'org.apache.httpcomponents', module: 'httpclient'
Check this:
implementation('org.apache.httpcomponents:httpmime:4.5.12') {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
implementation "org.apache.httpcomponents:httpcore:4.4.13"
Answered By - Kishan Solanki
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.