Dependency ignored because of conflict Android studio

Solution 1:

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
}

Solution 2:

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

configurations {
    compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}

Solution 3:

Use the following code to exclude the conflicting modules from the google APIs library.

 compile 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0' {
    exclude module: 'httpcore'
    exclude module: 'httpclient'
}