无法找到 com.github.rey5137:material:1.3.0

huangapple go评论123阅读模式
英文:

Could not find 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'

对于以下来自 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'
英文:
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'

I have been working on android studio nowadays but when I copied three dependencies the sync was not successful.Please help me out !!!!!
The dependencies which I copied from <https://github.com/rey5137/material> are given below

implementation &#39;com.github.rey5137:material:1.3.0&#39;
implementation &#39;androidx.cardview:cardview:1.0.0&#39;
implementation &#39;androidx.recyclerview:recyclerview:1.0.0&#39;

答案1

得分: 0

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

您可以将新的仓库添加到您的 build.gradle,这是您项目的主目录(根目录),(不是在 app 内!)

在文件末尾,您应该找到包含 repositoriesallprojects。在这里添加新的仓库:

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

因此它应该看起来像这样:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }        // <---- 添加这一行
    }
}

allprojects 部分可能位于 build.gradle 文件的底部)

英文:

They are also distribute this library via Jcenter.

You can add new repository to your build.gradle, which is main directory (root) of your project (not in app!!!).

To the end of the file you should find allprojects with repositories inside. Here add new repository:

maven { url &#39;https://jitpack.io&#39; }

So it should look like:

allprojects {
    repositories {
        maven { url &#39;https://jitpack.io&#39; }        &lt;---- add this line
    }
}

(section allprojects probably is on the bottom of the build.gradl file)

huangapple
  • 本文由 发表于 2020年4月7日 20:16:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/61079858.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定