Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependency ignored because of conflict Android studio

I'm trying to add the following dependency but it is ignore. I can't understand how to resolve it please help me Thank you.

Dependency

 compile 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0' 

Waring for ignoring dependency
Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages

like image 203
Asim Habib Avatar asked May 26 '15 13:05

Asim Habib


2 Answers

You can exclude dependencies in the build.gradle file of your module.

compile('com.google.apis:google-api-services-drive:v2-rev170-1.20.0') {     exclude module: 'httpclient' //by artifact name     exclude group: 'org.apache.httpcomponents' //by group     exclude group: 'org.apache.httpcomponents', module: 'httpclient' //by both name and group } 
like image 156
Aegis Avatar answered Oct 12 '22 23:10

Aegis


Exclude module httpclient from all configurations. Add this code in the build.gradle file:

configurations {     compile.exclude group: "org.apache.httpcomponents", module: "httpclient" } 
like image 43
teh.fonsi Avatar answered Oct 13 '22 00:10

teh.fonsi