android - 无法解析com.github.navasmdc:MaterialDesign:1.5

标签 android android-studio gradle

我正在尝试使用com.github.navasmdc:MaterialDesign:1.5,但它给我一个错误,说:

Could not resolve com.github.navasmdc:MaterialDesign:1.5.
 Required by:
     project :app
  > Could not resolve com.github.navasmdc:MaterialDesign:1.5.
     > Could not get resource 'https://jitpack.io/com/github/navasmdc/MaterialDesign/1.5/MaterialDesign-1.5.pom'.
        > Could not GET 'https://jitpack.io/com/github/navasmdc/MaterialDesign/1.5/MaterialDesign-1.5.pom'. Received status code 401 from server: Unauthorized

这就是build.gradle中的内容:
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "28.0.3"

defaultConfig {
    minSdkVersion 15
    targetSdkVersion 29
    versionCode 21
    versionName "1.0.4.1"
    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath false
        }
    }
}

flavorDimensions "pro"

productFlavors {
    pro {
        applicationId = "com.javiersantos.mlmanagerpro"
    }

}
flavorDimensions "basic"
productFlavors {
    basic {
        applicationId = "com.javiersantos.mlmanager"
    }
}


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

    debug {
        versionNameSuffix '-debug'
    }
}

lintOptions {
    disable 'MissingTranslation'
}

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
}

repositories {

mavenCentral()
maven { url 'http://guardian.github.com/maven/repo-releases' }
maven {
    url "https://maven.google.com"
}
maven { url "https://jitpack.io" }
}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'commons-io:commons-io:2.4'

//    implementation group: 'com.github.navasmdc', name: 'MaterialDesign', version: '1.5'

implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') { transitive = true; }
implementation('com.github.afollestad.material-dialogs:commons:0.8.5.3@aar') {
    transitive = true;
}
implementation 'com.github.yukuku:ambilwarna:2.0.1'
implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'xyz.danoz:recyclerviewfastscroller:0.1.3'
implementation 'com.yalantis:phoenix:1.2.2'
implementation('com.mikepenz:materialdrawer:4.6.1@aar') { transitive = true; }
implementation 'com.mikepenz:google-material-typeface:1.2.0.1@aar'
implementation('net.rdrei.android.dirchooser:library:3.0@aar') { transitive = true; }
implementation('com.mikepenz:aboutlibraries:5.2.1@aar') { transitive = true; }
annotationProcessor 'com.google.auto.value:auto-value:1.5.2'
implementation 'com.github.navasmdc:MaterialDesign:1.5@aar'
}

为什么我应该获得使用图书馆的授权?

注意:我也尝试过放置jcenter()google()

最佳答案

这个库是一个古老的库,您应该使用android在其核心和androidx之类的软件包中提供的现代 Material 设计组件。

但是,错误的主要问题是存储库已添加了授权,并且您需要具有凭据(用户名+密码)才能访问。正如我告诉图书馆的,它的最后贡献发生在大约4年前。因此,作者可能最近才获得证书,却忘记了访问图书馆的权限。

如果确实需要使用该库,here是其aar文件的链接,请下载它并手动将其添加到gradle项目中。

关于android - 无法解析com.github.navasmdc:MaterialDesign:1.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61259464/

相关文章:

java - 能够选择同一组中的两个单选按钮

android - 缺少DBFlow软件包-Gradle

android - Android Studio 2,2 中的错误

android - Android Studio 中的 Java 模块引用

android - 通过 json (url) 计算用户位置和餐厅位置之间的距离

android - 如何拦截点击TextView中的链接?

android - 如何使用Qt从iOS连接到蓝牙低功耗设备?

android - Android Studio 中出现 "No emulator installed"错误,即使英特尔 HAXM 已启动并正在运行

java - IntelliJ Idea 没有看到依赖,这是 Gradle 添加的

groovy - Gradle 2 - 自定义插件的 CopySpec 属性