Jude Fernandes
Jude Fernandes

Reputation: 7517

Unable to update gradle dependency for a library

This is what i originally had in my build.gradle file.

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.github.clans:fab:1.6.1'
    compile 'joda-time:joda-time:2.8.2'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.afollestad:material-dialogs:0.7.9.1'
    compile 'com.wdullaer:materialdatetimepicker:1.5.3'
    compile 'com.android.support:palette-v7:23.0.1'
}

The library Material Dialog has been updated so i am trying to reflect the same in my gradle file.The library says i should add it like this.

    dependencies {
    compile('com.afollestad.material-dialogs:core:0.8.1.0@aar') {
        transitive = true
    }
}

So i tried this but it refuses to rebuild the project when i try this,with an error saying "failed to resolve:com.afollestad.material-dialogs:core:0.8.1.0"

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.github.clans:fab:1.6.1'
    compile 'joda-time:joda-time:2.8.2'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.wdullaer:materialdatetimepicker:1.5.3'
    compile 'com.android.support:palette-v7:23.0.1'
    compile('com.afollestad.material-dialogs:core:0.8.1.0@aar') {
        transitive = true
    }
}

Could someone tell me what i am doing wrong here.

Upvotes: 0

Views: 6089

Answers (2)

cgr
cgr

Reputation: 4636

I had the same problem while building [Material-Dialogs][1].

In my case I had to have the same level of Build Tools version as that of the compileSdkVersion. For more info, visit Android ProgressDialog position issue and do we have Android's ProgressDialog from platform or support library? answer.

I had (mismatching compile SDK and build tool versions):

 android {    
    compileSdkVersion 23
    buildToolsVersion '22.0.1'
    ...[your configuration]
}

which I changed to

android {    
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    ...[your configuration]
}

Upvotes: 0

NaviRamyle
NaviRamyle

Reputation: 4007

It should be like this

App build.gradle

dependencies {
    compile('com.afollestad.material-dialogs:core:0.8.1.0@aar') {
        transitive = true
    }
}

Project build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

Upvotes: 12

Related Questions