首页 > 解决方案 > 找不到 com.github.rey5137:material:1.3.0

问题描述

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.ecommerce"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

}

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

    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.firebase:firebase-analytics:17.3.0'
    implementation 'com.github.rey5137:material:1.3.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
apply plugin: 'com.google.gms.google-services'

我现在一直在 android studio 上工作,但是当我复制三个依赖项时,同步不成功。请帮帮我!!!!!!我从https://github.com/rey5137/material复制的依赖项如下所示

implementation 'com.github.rey5137:material:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'

标签: javaandroiddependenciesbuild.gradleandroid-cardview

解决方案


他们还通过 Jcenter 分发这个库。

您可以将新存储库添加到您build.gradle的项目的主目录(根目录)中(不在app!!!)

到文件的末尾,您应该在allprojects里面找到repositories。在这里添加新的存储库:

maven { url 'https://jitpack.io' }

所以它应该看起来像:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }        <---- add this line
    }
}

(部分allprojects可能在build.gradl文件的底部)


推荐阅读