0

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.

Edric
  • 24,639
  • 13
  • 81
  • 91
Jude Fernandes
  • 7,437
  • 11
  • 53
  • 90
  • I had the same kind of problem for another library, since the project is on github you can try to import it by downloading it as a zip file – Virthuss Oct 02 '15 at 04:25

2 Answers2

12

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" }
    }
}
NaviRamyle
  • 3,967
  • 1
  • 31
  • 49
0

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]
}
Community
  • 1
  • 1
cgr
  • 4,578
  • 2
  • 28
  • 52