Gradle无法在Android Studio中解析材质对话框依赖项

Man*_*anu 2 android gradle android-gradle-plugin material-design

我正在尝试构建从Git存储库导入的Android应用程序.这个相同的应用程序在另一个环境中正确构建,但在我的环境中,我收到以下错误:

Error:(41, 13) Failed to resolve: com.afollestad:material-dialogs:0.7.7.0
Run Code Online (Sandbox Code Playgroud)

我的build.gradle:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 22
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "my.app.id"
        minSdkVersion 16
        targetSdkVersion 22
        multiDexEnabled true
        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 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.afollestad:material-dialogs:0.7.7.0'
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    compile 'com.github.navasmdc:MaterialDesign:1.2'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
    compile 'com.squareup.okhttp:okhttp:2.1.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'joda-time:joda-time:2.3'
    compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
    compile 'com.andreabaccega:android-form-edittext:1.2.1@aar'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true;
    }
}
Run Code Online (Sandbox Code Playgroud)

我也尝试了不同的版本(0.7.7.0,0.7.6.0,0.7.5.5),但没有任何变化.我该如何解决我的问题?

Mat*_*ini 7

jCenter上,只有两个版本可用0.7.9.0和0.7.9.1.这些版本在Maven Central中不可用,因此请检查build.gradle您正在使用的项目jcenter().

BTW这些版本没有更新,GitHub上发布的最新版本是0.8.5.1.

要在项目中使用最新版本,请使用以下说明:

知识库

首先,将以下内容添加到应用程序的build.gradle文件中:

repositories {
  maven { url "https://jitpack.io" }  
}      
Run Code Online (Sandbox Code Playgroud)

核心

核心模块包含此库的所有主要类,包括MaterialDialog和AlertDialogWrapper.您可以使用核心创建基本,列表,单/多选,进度,输入等对话框.

dependencies {

  // ... other dependencies here

  compile('com.github.afollestad.material-dialogs:core:0.8.5.1@aar') {
      transitive = true
  }   
}
Run Code Online (Sandbox Code Playgroud)