错误:无法解决:com.afollestad:material-dialogs:2.0.0

时间:2019-02-09 08:35:24

标签: android gradle build.gradle

我使用Android Studio 3.3,并且在我的项目中,将com.afollestad.material-dialogs添加到Gradle时,com.afollestad.material-dialogs:core:2.0.0出现了问题,显示错误:无法解决:com.afollestad.material-dialogs:core:2.0.0,

这是我的Gradle:项目

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'

    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

我的Gradle:应用

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "com.pongodev.recipesapp"
        minSdkVersion 20
        targetSdkVersion 28
        versionCode 5
        versionName "3.0.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // Main libraries, you always need this libraries in your project. do not remove them.
    implementation'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.android.gms:play-services:12.0.1'

    // Important library to create material design. do not remove this.
    implementation project(':materialDesign')

    // Library to create tabbar
    implementation 'com.jpardogo.materialtabstrip:library:1.0.6'

    // Library to create ripple effect. work together with materialDesign library.
    implementation 'com.github.traex.rippleeffect:library:1.3'

    // Library to create rounded, circle, and any shape image.
    implementation 'com.makeramen:roundedimageview:1.4.0'

    // Library load lazy images.
    implementation 'com.squareup.picasso:picasso:2.71828'

    // Library to create simple list.
    implementation 'com.android.support:recyclerview-v7:28.0.0'

    // Library to create complex clickable list.
    implementation 'com.android.support:cardview-v7:28.0.0'

    // Library to create material dialog.
    implementation 'com.afollestad:material-dialogs:2.0.0'

    // Library to create animation imageview.
    implementation 'com.flaviofaria:kenburnsview:1.0.5'

}

我的摇篮:materialDesign

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 20
        targetSdkVersion 28
    }

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

dependencies {
    implementation 'com.android.support:support-v4:28.0.0'
    implementation files('libs/nineoldandroids-2.4.0.jar')
}

1 个答案:

答案 0 :(得分:0)

在应用模块的gradle文件中将implementation 'com.afollestad.material-dialogs:2.0.0'更改为implementation 'com.afollestad.material-dialogs:core:2.0.0'

编辑:

确保在项目级别的build.gralde文件中已经有maven { url 'https://jitpack.io' }这一行。如果不存在,则添加此行,如

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

   }
}