无法解决:com.android.support.cardview-v7:28.0.0:

时间:2018-11-14 14:56:00

标签: android android-recyclerview android-cardview cardview gradle-dependencies

尝试将卡片视图和回收者视图依赖项添加到我的应用程序时,出现上述错误。

下面是我在应用程序级别build.gradle中的依赖项:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-core-utils:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'

implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'

implementation 'com.android.support.cardview-v7:28.0.0'
implementation 'com.android.support.recyclerview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'


implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
}

我相信我在项目级别buildgradle中具有与存储库相关的输入,如下所示。所以我不确定为什么会收到此错误。

    buildscript {

   repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'



    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }

}

1 个答案:

答案 0 :(得分:3)

您使用点代替冒号

  

实现'com.android.support.cardview-v7:28.0.0'

应该是

  

实现'com.android.support:cardview-v7:28.0.0'

以及您的回收站视图:

  

实现'com.android.support:recyclerview-v7:28.0.0'