Failed to resolve: com.android.support:cardview-v7

2018-12-31 02:16发布

i try to add recyclerview to my project and get this error appear and i added it from android studio dependencies this is error appear when try to add recyclerview in android studio

this is the compiled version ...

23条回答
只若初见
2楼-- · 2018-12-31 02:22

May be this problem is due to facebook library. Replace

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

by

compile 'com.facebook.android:facebook-android-sdk:4.26.0'
查看更多
低头抚发
3楼-- · 2018-12-31 02:24

Google's new Maven repo is required for the latest support library that is compatible with Android 8.0. Just update your Google's Maven repository like below:

To add them to your build, add maven.google.com to the Maven repositories in your module-level build.gradle file:

repositories {
    maven {
        url 'https://maven.google.com'
        // Alternative URL is 'https://dl.google.com/dl/android/maven2/'
    }
}

Alternative you can update build.gradle file like this:

    repositories {
        jcenter()
        google()
    }

Then add the desired library to your dependencies block. For example, the cardview library looks like this:

dependencies {
    compile 'com.android.support:cardview-v7:26.1.0'
}
查看更多
只靠听说
4楼-- · 2018-12-31 02:24

Use compile 'com.android.support:cardview-v7:25.4.0'
If you want version 26 you should use compile 'com.android.support:cardview-v7:26.0.0-beta2', because it is beta for now

查看更多
时光乱了年华
5楼-- · 2018-12-31 02:25

try to compile

 compile 'com.android.support:cardview-v7:25.3.1'
查看更多
谁念西风独自凉
6楼-- · 2018-12-31 02:26

Starting from version 26 of support libraries make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint.

Something like;

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
查看更多
与君花间醉酒
7楼-- · 2018-12-31 02:27

Update your Android Support Repository from sdk manager.

查看更多
登录 后发表回答