dev90
dev90

Reputation: 7519

How to exclude internal libraries from Gradle

These are the libraries that twitter SDK is using.

+--- com.twitter.sdk.android:twitter:2.1.0
|    +--- com.twitter.sdk.android:twitter-core:2.1.0
|    |    +--- io.fabric.sdk.android:fabric:1.3.14
|    |    \--- com.squareup.retrofit2:retrofit:2.0.2
|    |         \--- com.squareup.okhttp3:okhttp:3.2.0
|    |              \--- com.squareup.okio:okio:1.6.0

Its using okhttp3 library, and i need to exclude it, I have tried following, but this is not excluding the okhttp3 library.

 exclude group:'com.squareup.okhttp3', module:'okhttp'

I don't want to exclude parent libraries, just the child library.

Upvotes: 0

Views: 3392

Answers (1)

wasyl
wasyl

Reputation: 3506

You can try to force specific version of a library:

configurations.all {
    resolutionStrategy { 
        force 'com.squareup.okhttp3:okhttp:<<older version>>'
    }
}

or

compile 'com.squareup.okhttp3:okhttp:<<older version>>' {
  force = true
}

Upvotes: 2

Related Questions