In my build.gradle
I have the support library as a dependency, as seen here force to revision 19.
compile 'com.android.support:support-v4:19.1.+
With revision 21 the Material Design support was introduced. I don't want to use the Material Design in this case here which is fine. The problem arises through the use of the Fabric SDK
:
I include their Maven repository maven { url 'https://maven.fabric.io/repo' }
and compile the Twitter dependencies:
compile('com.twitter.sdk.android:twitter:1.0.0@aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter-core:1.0.0@aar') {
transitive = true;
}
Now what happens is that I get the support library in revision 21. What happened here? Does the Fabric SDK use the neweset support library?
How can I force it to revision 19 anyway?
When you specify a dependency in your build script, you can provide an exclude rule at the same time telling Gradle not to pull in the specified transitive dependency. For example, say we have a Gradle project that depends on Google's Guava library, or more specifically com.
Go to Android Studio -> Preferences -> Plugins (for Mac) and File -> Settings -> Plugins (for windows) and search “Check for Dependency updates plugin”. Install it and restart android studio. You will be able to see Dependencies tab on the right which will show if any dependency has a new update available.
Feel free to exclude the Android Support Library and provide your own version.
compile('com.twitter.sdk.android:twitter:1.0.0@aar') {
transitive = true;
exclude module: 'support-v4'
}
Make sure you provide your own version though, otherwise you'll get runtime errors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With