1

I, m using Android Studio 2.1.2, and in my project I hava a problem with com.afollestad.material-dialogs:core:0.8.5.2, when I add com.afollestad.material-dialogs to my Gradle, error was show: Failed to resolve: com.afollestad.material-dialogs:core:0.8.5.2,

Here is my Gradle:

buildscript {
 repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
allprojects {
repositories {
    jcenter()
    mavenLocal()
    mavenCentral()
    maven { url "https://jitpack.io" }
}

And this is my Gradle: app

apply plugin: 'com.android.application'

android {
 configurations.all {
   resolutionStrategy.force 'com.android.support:support-annotations:25.3.1'
}
compileSdkVersion 25
buildToolsVersion "24.0.2"

defaultConfig {
    applicationId "com.panaceasoft.mokets"
    minSdkVersion 14
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/android-async-http-1.4.4.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.github.rey5137:material:1.2.2'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.stripe:stripe-android:2.0.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'me.zhanghai.android.materialprogressbar:library:1.1.4'

compile('com.afollestad.material-dialogs:core:0.8.5.2@aar') {
    transitive = true
}
androidTestCompile 'com.android.support:support-annotations:25.1.3'}

apply plugin: 'com.google.gms.google-services'

And this is my SDK manager: sdk manager

sdk manager

sdk manager

sdk manager

when I remove

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

everything is fine and gradle build finished with no errors,

Zoe
  • 27,060
  • 21
  • 118
  • 148

2 Answers2

1

You should use the latest version instead of aar.

compile 'com.afollestad.material-dialogs:core:0.9.6.0'

NOTE

You should upgrade your versions

classpath 'com.google.gms:google-services:3.2.0'
classpath 'com.android.tools.build:gradle:3.1.2'

Then

compileSdkVersion 27
buildToolsVersion "27.0.3"

Then

compile 'com.android.support:appcompat-v7:27.1.1'

Finally

repositories {
        jcenter()
       // google()
        maven {
            url "https://maven.google.com"
        }
    }
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

try with the latest version of the library

compile 'com.afollestad.material-dialogs:core:0.9.6.0'
ColdFire
  • 6,764
  • 6
  • 35
  • 51
nitish29
  • 327
  • 1
  • 7
  • when i use `compile 'com.afollestad.material-dialogs:core:0.9.6.0'` i have this error : Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1 Install Repository and sync project Open File Show in Project Structure dialog – Naser Rajaei May 15 '18 at 09:30