android – 无法解决:recyclerview-v7

在我的项目中添加依赖项实现’com.azoft.carousellayoutmanager:carousel:1.2.4’时,Android Studio会抛出异常,无法解析:recyclerview-v7.然后我尝试为recyclerview添加依赖项.仍然得到同样的错误.
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.someapp"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"

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

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.squareup.retrofit2:retrofit:2.1.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.3.1'
    implementation 'com.commonsware.cwac:saferoom:0.4.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.android.support:cardview-v7:27.1.1'
}

apply plugin: 'com.google.gms.google-services'

我有同样的问题,我在biuld.gradle(app)中更改了存储库的顺序,问题解决了.

变化:

jcenter()
 google()

至 :

google()
 jcenter()

希望它有所帮助

翻译自:https://stackoverflow.com/questions/50891617/failed-to-resolve-recyclerview-v7