Mahoni
Mahoni

Reputation: 7466

Prevent Gradle dependency for support library from being overridden by newer version

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?

Upvotes: 5

Views: 1565

Answers (2)

Ty Smith
Ty Smith

Reputation: 2594

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

Upvotes: 10

bjiang
bjiang

Reputation: 6078

You can modify the build.gradle as

android {
    compileSdkVersion 19
    buildToolsVersion "19.1"

Also, please make sure you downloaded the build tools for API 19 in SDK manager.

Upvotes: -1

Related Questions